Quote:
cannot convert from 'system.drawing.bitmap' to 'tesseract.pix'
Based on error, seems
Process()
is expecting parameter of type
tesseract.pix
and not an
bitmap
.
Believe there is something like
PixConverter[
^] that can be used:
using (var img = PixConverter.ToPix(imgsource))
{
using (var page = engine.Process(img))
{
ocrtext = page.GetText();
}
}
Example reference:
tesseract-samples/Program.cs [
^]
Alternatively, looking at the demo sample provided, it seems you need to do following:
var tesseractPath = solutionDirectory + @"\tesseract-master.1153";
var imageFile = File.ReadAllBytes(fileName);
var text = ParseText(tesseractPath, imageFile, "eng", "fra");
Console.WriteLine("File:" + fileName + "\n" + text + "\n");
Reference:
GitHub - doxakis/How-to-use-tesseract-ocr-4.0-with-csharp: How to use Tesseract OCR 4.0 with C#[
^]