Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.69 KB | None | 0 0
  1.  Dim XmlDoc As New XmlDocument
  2.         Dim bild As New Bitmap("C:\Users\denni\Desktop\screenshot.jpg")
  3.         bild = InvertColors(bild)
  4.         Dim ocrtext = String.Empty
  5.         Using engine = New TesseractEngine("./tessdata", "eng", EngineMode.Default)
  6.             Using img = PixConverter.ToPix(bild)
  7.                 Using page = engine.Process(img)
  8.                     ocrtext = page.GetAltoText(1)
  9.                 End Using
  10.             End Using
  11.         End Using
  12.  
  13.         XmlDoc.LoadXml(ocrtext)
  14.  
  15.         For index As Integer = 2 To 6
  16.             MsgBox(XmlDoc.SelectSingleNode("/Page/PrintSpace/TextBlock" & "[" & index & "]" & "/TextLine[2]/String/@CONTENT").Value)
  17.         Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement