Beispiel #1
0
        public string Search(Bitmap img)
        {
            float max_similarity = 0;
            float similarity;
            int   i = 0;

            string name_of_gesture = "";

            Image_Comparison cmp = new Image_Comparison();

            foreach (Bitmap img2 in gestures)
            {
                similarity = cmp.Overlay_Comparison(img, img2);

                if (similarity > max_similarity)
                {
                    max_similarity  = similarity;
                    name_of_gesture = gestures_name[i];
                }

                i++;
            }

            return(name_of_gesture);
        }
Beispiel #2
0
        public static void Update_Base()
        {
            Grayscale FilterGrayscale = new Grayscale(Data.Red, Data.Green, Data.Blue);

            string[] files = Directory.GetFiles(Data.Path, "hand*.jpg", SearchOption.TopDirectoryOnly);

            gestures.Clear();
            gestures_name.Clear();

            Image_Comparison cmp = new Image_Comparison();

            foreach (string file in files)
            {
                Bitmap bmp = new Bitmap(file);
                gestures.Add(FilterGrayscale.Apply(bmp)); //??
                gestures_name.Add(Path.GetFileNameWithoutExtension(file));
            }
        }