Error while retrieving text from image

35 views
Skip to first unread message

prasanth kotagiri

unread,
Nov 10, 2020, 4:39:57 AM11/10/20
to tesseract-ocr
Hi,

I am getting the error as like below for the code snippet.

cannot convert from 'System.Drawing.Bitmap' to 'Tesseract.Pix'

Code:

using System.Drawing;
using Tesseract;

Bitmap img = (Bitmap)Bitmap.FromFile("/Users/prkotagi/Desktop/Test.bmp");
TesseractEngine engine = new TesseractEngine("/Volumes/Macintosh HD - Data/Csharpcode/eng.traineddata","eng",EngineMode.Default);
Page page = engine.Process(img, PageSegMode.Auto);
string result = page.GetText();
Console.WriteLine(result);
Reply all
Reply to author
Forward
0 new messages