Ejemplo n.º 1
0
        //overload
        public String recognize(List <String> labels,
                                List <Bitmap> images,
                                Byte[] image, RECOGNIZER type)
        {
            String            label = String.Empty;
            Image <Bgr, Byte> face  = new Image <Bgr, Byte>(320, 240);

            face.Bytes = image;
            List <Image <Gray, Byte> > trainingImages = new List <Image <Gray, Byte> >();

            foreach (Bitmap bmp in images)
            {
                Image <Gray, Byte> img = new Image <Gray, Byte>(bmp);
                trainingImages.Add(img);
            }

            switch (type)
            {
            case RECOGNIZER.LBPH_RECOG:
                label = recognizeLBPHFace(labels, trainingImages, face);
                break;

            case RECOGNIZER.PCA_RECOG:
                label = recognizeEigenFace(labels, trainingImages, face);
                break;

            case RECOGNIZER.FISHER_FACE_RECOG:
                label = recognizeFisherFace(labels, trainingImages, face);
                break;
            }

            return(label);
        }
Ejemplo n.º 2
0
        public String recognize(List <String> labels,
                                List <Image <Gray, Byte> > trainingImages,
                                Image <Bgr, Byte> face, RECOGNIZER type)
        {
            String label = String.Empty;

            switch (type)
            {
            case RECOGNIZER.LBPH_RECOG:
                label = recognizeLBPHFace(labels, trainingImages, face);
                break;

            case RECOGNIZER.PCA_RECOG:
                label = recognizeEigenFace(labels, trainingImages, face);
                break;

            case RECOGNIZER.FISHER_FACE_RECOG:
                label = recognizeFisherFace(labels, trainingImages, face);
                break;
            }

            return(label);
        }