Example #1
0
        public void TestRecognizeImage()
        {
            //var x = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase),"3.jpg");
            //Image image = Image.FromFile(x);
            Image  image  = Image.FromFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "3.jpg"));
            string result = OCRUtil.RecognizeImage((Bitmap)image);

            Assert.AreNotEqual("0", result.Length);
        }
Example #2
0
        public void TestMagnifyImage()
        {
            //Console.WriteLine(Directory.GetCurrentDirectory());
            //Image image = Image.FromFile(Resources.image);
            Image image  = Image.FromFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "1.png"));
            Image result = OCRUtil.MagnifyImage(image, 5);

            Assert.AreEqual((image.Width) * 5, result.Width);
        }
        public async Task <ActionResult> OCRVerification(HttpPostedFileBase file)
        {
            List <string> palabras = await OCRUtil.GetText(file);

            string fromPrincipal = Request["isPrincipal"];

            if (fromPrincipal != null)
            {
                INEData objOcr = FindCampos(palabras);
                return(Json(objOcr, JsonRequestBehavior.AllowGet));
            }


            return(Json(palabras, JsonRequestBehavior.AllowGet));
        }