예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            AnimalIdentifier_Base.TagReader find = new AnimalIdentifier_Base.TagReader();
            ImageTagger item = new ImageTagger();
            List <Tag>  tags = item.GetTagsForImage(Grab_Path.Text);

            foreach (Tag tag in tags)
            {
                find.Polymorphic(find.check_Dog, tag);
                find.Polymorphic(find.check_Cat, tag);
                find.Polymorphic(find.check_Bird, tag);
            }

            Found_dog.Checked = find.check_Dog.Is_found;

            //if (find.check_Dog.Is_found == true)
            //    Found_dog.Checked = true;
            //if (find.check_Cat.Is_found == true)
            //    Found_cat.Checked = true;
            //if (find.check_Bird.Is_found == true)
            //    Found_bird.Checked = true;

            //if (Found_dog.Checked == Found_cat.Checked && Found_dog.Checked == true)
            //{
            //    if (Found_dog == Found_bird)
            //        View_output.Text = "A Bird, A cat and A dog are in this picture";
            //    else
            //        View_output.Text = "A dog and a cat are in this picture";
            //}
            //else if (Found_bird.Checked == Found_cat.Checked && Found_cat.Checked == true)
            //    View_output.Text = "A bird and a cat are in this picture";
            //else if (Found_dog.Checked == Found_bird.Checked && Found_bird.Checked == true)
            //    View_output.Text = "A bird and a dog are in this picture";
            //else if (Found_dog.Checked)
            //    View_output.Text = "A dog is in this picture";
            //else if (Found_cat.Checked)
            //    View_output.Text = "A cat is in this picture";
            //else if (Found_bird.Checked)
            //    View_output.Text = "A bird is in this picture";
            //else
            //    View_output.Text = "This picture contains no animals";
        }
예제 #2
0
        static void Main()
        {
            TagReader find = new TagReader();

            // Get the path and filename to process from the user.
            Console.WriteLine("Analyze an image:");
            Console.Write("Enter the path to an image you wish to analzye: ");
            string imageFilePath = Console.ReadLine();

            ImageTagger animalImageTagger = new ImageTagger();
            List <Tag>  tags = animalImageTagger.GetTagsForImage(imageFilePath);


            //Collects information on animal tags
            foreach (Tag tag in tags)
            {
                find.Polymorphic(find.check_Dog, tag);
                find.Polymorphic(find.check_Cat, tag);
                find.Polymorphic(find.check_Bird, tag);

                Console.WriteLine(tag.name);
            }

            Console.WriteLine("\n");
            //Decides what to do once tag information is gathered
            SearchResult results = find.animal_Found();

            // TODO: move all console display logic here

            if (results.FoundDog)
            {
                Console.WriteLine("found dog");
            }

            Console.WriteLine("Press Any Key to Continue.");
            Console.ReadLine();
        }