Example: This is a line in image
image
Loop Until items.Next(Tesseract.PageIteratorLevel.TextLine, Tesseract.PageIteratorLevel.Word)
Dim engine As New Tesseract.TesseractEngine("tessdata", "eng", Tesseract.EngineMode.TesseractOnly) Dim page As Tesseract.Page = engine.Process(New Bitmap("imagepath")) Dim items As Tesseract.ResultIterator = page.GetIterator() items.Begin() MsgBox(page.GetMeanConfidence) Console.WriteLine("Mean Confidence: " & page.GetMeanConfidence) Console.WriteLine("") Dim i As Integer = 1 Do 'If i Mod 2 = 0 Then Console.Write("Line " & i & " ") Do If items.IsAtBeginningOf(Tesseract.PageIteratorLevel.Block) Then Console.WriteLine("New Block" & vbNewLine) End If If items.IsAtBeginningOf(Tesseract.PageIteratorLevel.Para) Then Console.WriteLine("New Paragraph" & vbNewLine) End If If items.IsAtBeginningOf(Tesseract.PageIteratorLevel.TextLine) Then Console.WriteLine("New TextLine" & vbNewLine) End If Console.WriteLine(items.GetText(Tesseract.PageIteratorLevel.Word)) Loop Until items.Next(Tesseract.PageIteratorLevel.TextLine, Tesseract.PageIteratorLevel.Word) 'End If i = i + 1 Loop Until items.Next(Tesseract.PageIteratorLevel.Para, Tesseract.PageIteratorLevel.TextLine) 'RichTextBox1.Text = page.GetText() engine.Dispose() MsgBox("done")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)