25/04/13 7:39
coyote100
SALVE STO LAVORANDO SUL SISTEMA OCR PER CONVERTIRE LE IMMAGINI IN TESTO.
MI DA ERRORE "Exception.InnerException. Errore: L'inizializzatore di tipo di 'Emgu.CV.OCR.Tesseract' ha generato un'eccezione."
CODICE
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(MousePosition, 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
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
LE DLL LE HO CARICATE, IL PROGRAMMA PARTE MA DA L'ERRORE CHE HO RIPORTATO SOPRA.
MI DA ERRORE "Exception.InnerException. Errore: L'inizializzatore di tipo di 'Emgu.CV.OCR.Tesseract' ha generato un'eccezione."
CODICE
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(MousePosition, 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
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
LE DLL LE HO CARICATE, IL PROGRAMMA PARTE MA DA L'ERRORE CHE HO RIPORTATO SOPRA.
aaa