예제 #1
0
        public void OCRNotNull()
        {
            // open image to Bitmap
            Bitmap bitmap = new Bitmap(@"C:/Users/Deividas/Pictures/Camera Roll/Annotation.png");

            // Runs OCR
            var result = _recognition.OCR(bitmap);

            // Check if returns not null
            Assert.IsNotNull(result);
        }
예제 #2
0
        /// <summary>
        /// Browse system to upload an image (should be able to take a picture eventually)
        /// </summary>
        private void Take_Picture()
        {
            // Creates new file handling object
            IDB file = new FileIO();

            // Takes image from local storage
            string img = file.PullImage();

            // Quits method if no image was opened
            if (img == null)
            {
                return;
            }

            // Displays information about the ID
            Show_Info();

            // Creates new bitmap object
            Bitmap Image = new Bitmap(img);

            // Named arguments mixed
            FaceImg.Image = test.Recognizer(option: Recognition <string> .Option.CropFace, bit: Image);

            // Makes image easier to recognize; second argument is default
            Bitmap rec = test.Recognizer(Image);

            // Loads and displays image
            ImgBox.Image = rec;

            // Changes image box maximum size to uploaded image size
            ImgBox.MaximumSize = Image.Size;

            // Displays image path
            ImageNameLabel.Text = img;

            RecognizedText.Text = test.OCR(Image);
        }