DEV Community

IronSoftware
IronSoftware

Posted on • Originally published at ironsoftware.com

MultiThreaded Tesseract OCR

IronTesseract 2021 used to have a ReadMultithreaded method to allow .NET developers to read images and PDFs more efficiently.

This is no longer needed in 2022. All IronOCR image processing and OCER reading operations are multithreaded and do not require the developer to use a special API.

IronTesseract will automatically attempt to use all threads available on all cores, and will consider responsiveness on the main / GUI thread elegantly.

C#:

using IronOcr;

var Ocr = new IronTesseract();

using (var Input = new OcrInput())
{
    Input.AddPdf("scan.pdf")

    // Image processing is automatically multi-threaded
    Input.Deskew();

    // OCR reading is automatically multi-threaded too
    var Result = Ocr.Read(Input);     
}
Enter fullscreen mode Exit fullscreen mode

VB:

Imports IronOcr

Private Ocr = New IronTesseract()

Using Input = New OcrInput()
    Input.AddPdf("scan.pdf") Input.Deskew()

    ' OCR reading is automatically multi-threaded too
    Dim Result = Ocr.Read(Input)
End Using
Enter fullscreen mode Exit fullscreen mode

Top comments (0)