Exemplo n.º 1
0
        public String RecognizeFromOcto(int[] pixels, int size)
        {
            Logger.WriteMessage("Recognizing OCto");
            var imgFace = ImagesProcessing.DetectAndTrimFace(pixels, size, fixedFaceSize);

            if (imgFace == null)
            {
                return("No face detected on the image");
                //imgFace.Save(@"e:\data\phototest\trimed.jpg");
            }
            Logger.WriteMessage("Face detected");
            var equalized = ImagesProcessing.EqualizeHist(imgFace);

            Logger.WriteMessage("Face equalized");
            var folder = FileAccessUtil.GetFolder();

            Logger.WriteMessage("Folder obtained");
            var recognizer = ImagesProcessing.CreateRecognizerFromFotosInFolder(folder, "_" + fixedFaceSize, 0.001, 3000);

            Logger.WriteMessage("Recognizer created");
            String label = recognizer.Recognize(equalized);

            if (!String.IsNullOrEmpty(label))
            {
                return(label);
            }

            return("Could not recognize");
        }
 public void CreateImageRecognizerTest()
 {
     ImagesProcessing.CreateRecognizerFromFotosInFolder(@"e:\data\photos\", "_100", 0.001, 500);
 }