using IronOcr;
var Ocr = new IronTesseract();
using (var Input = new OcrInput(@"images\image.png"))
{
Input.WithTitle("My Document");
Input.Binarize();
Input.Contrast();
Input.Deskew();
Input.DeNoise();
Input.Dilate();
Input.EnhanceResolution(300);
Input.Invert();
Input.Rotate(90);
Input.Scale(150); // or Input.Scale(3000, 2000);
Input.Sharpen();
Input.ToGrayScale();
// you don't need all of them
// most users only need Deskew() and occasionally DeNoise()
var Result = Ocr.Read(Input);
Console.WriteLine(Result.Text);
}
Imports IronOcr
Private Ocr = New IronTesseract()
Using Input = New OcrInput("images\image.png")
Input.WithTitle("My Document")
Input.Binarize()
Input.Contrast()
Input.Deskew()
Input.DeNoise()
Input.Dilate()
Input.EnhanceResolution(300)
Input.Invert()
Input.Rotate(90)
Input.Scale(150) ' or Input.Scale(3000, 2000);
Input.Sharpen()
Input.ToGrayScale()
' you don't need all of them
' most users only need Deskew() and occasionally DeNoise()
Dim Result = Ocr.Read(Input)
Console.WriteLine(Result.Text)
End Using