我试图通过
我的代码
从图像Aspose.OCR
中
提取文本:
Const resourceFileName As String = "c:\2011.08.05 v1.1 Aspose.OCR.Resouces.zip"
Dim uploadedImage As String = "c:\ConvertMeToText.bmp"
Try
'Create OcrEngine instance and assign
'image, language and image configuration
Dim ocr As New OcrEngine()
ocr.Image = ImageStream.FromFile(uploadedImage)
ocr.Languages.AddLanguage(Language.Load("english"))
ocr.Config.NeedRotationCorrection = True
ocr.Config.UseDefaultDictionaries = True
Dim fileStream As New FileStream(resourceFileName, FileMode.Open)
ocr.Resource = fileStream
Try
If ocr.Process() Then
TextBox1.Text = ocr.Text.ToString()
End If
Catch ex As Exception
MsgBox("Exception: " & ex.Message)
End Try
fileStream.Close()
ocr = Nothing
Catch ex As Exception
MsgBox("Exception: " & ex.Message)
End Try
例外:ZipEntry::ReadHeader(): 位置 0x00000000 处的错误签名 (0x00000100)