public IActionResult FileUpload(UploadFile uploadFile) { UploadFile updata = new UploadFile(); using (MemoryStream ms = new MemoryStream()) { uploadFile.FormFile.CopyTo(ms); byte[] fileBytes = ms.ToArray(); ProcessCaptured processCaptured = new ProcessCaptured(); var image = Image.FromStream(ms); Image <Bgra, Byte> imgg = processCaptured.GetImageFromStream(ms); updata = processCaptured.ProcessImage(imgg); } return(View("Index", updata)); }
public IActionResult Index() { string path = AppContext.BaseDirectory; ProcessCaptured processCaptured = new ProcessCaptured(); ////string path = server.Map var _ocr = new Tesseract(path, "eng", OcrEngineMode.Default); //Image<Bgr, Byte> imgg = new Image<Bgr, byte>(path + "\\Untitled.png"); Image <Bgr, Byte> imgg = new Image <Bgr, byte>(path + "\\eucar.jpg"); processCaptured.ProcessImage(imgg); _ocr.SetImage(imgg); _ocr.Recognize(); var result = _ocr.GetCharacters(); return(View()); }