【问题标题】:vb.net Aspose.OCR - Extract text from Imagevb.net Aspose.OCR - 从图像中提取文本
【发布时间】:2012-08-22 17:38:16
【问题描述】:

我尝试从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(): 错误签名 (0x00000100) 在位置 0x00000000

【问题讨论】:

    标签: vb.net winforms bitmap aspose


    【解决方案1】:

    我叫 Nayyer,在 Aspose 担任支持开发人员/技术传播者。

    从异常来看,Aspose.OCR 版本和资源文件版本似乎存在一些差异。每个 Aspose.OCR 版本都使用一个单独的 resources.zip 文件,如果您尝试将 Aspose.OCR v1.0.0 与 2011.08.05 v1.1 Aspose.OCR.Resouces.zip 一起使用,那么您可能会遇到类似的异常。或许你可以试试Aspose.OCR v.1.1.0的最新版本,它的兼容资源文件在this link上可用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多