Loading...

Visual Basic How To: OCR! Object Character Recognition

110,399 views

Loading...

Loading...

Transcript

The interactive transcript could not be loaded.

Loading...

Loading...

Rating is available when the video has been rented.
This feature is not available right now. Please try again later.
Published on Jul 16, 2012

Awesome software that can read text from pictures!
When copy-n-pastin, make sure 'Handles something' is at the end of your events!

By default, your programs are 32bit, if you are using the 64bit EmguCV, you need to make your program a 64bit program. Here is how: http://www.youtube.com/watch?v=mZXUw-...

Code:
Imports Emgu.CV
Imports Emgu.Util
Imports Emgu.CV.OCR
Imports Emgu.CV.Structure

Public Class Form1

Dim OCRz As Tesseract = New Tesseract("tessdata", "eng", Tesseract.OcrEngineMode.OEM_TESSERACT_ONLY)
Dim pic As Bitmap = New Bitmap(270, 100)
Dim gfx As Graphics = Graphics.FromImage(pic)

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

'If Windows XP
gfx.CopyFromScreen(New Point(Me.Location.X + PictureBox1.Location.X + 4, Me.Location.Y + PictureBox1.Location.Y + 30), New Point(0, 0), pic.Size)
PictureBox1.Image = pic

'If Windows 7
'gfx.CopyFromScreen(MousePositi­on, New Point(0, 0), pic.Size)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

OCRz.Recognize(New Image(Of Bgr, Byte)(pic))
RichTextBox1.Text = OCRz.GetText

End Sub
End Class

Loading...

Advertisement
When autoplay is enabled, a suggested video will automatically play next.

Up next


to add this to Watch Later

Add to

Loading playlists...