Tesseract on VB.Net



我正在进行一个使用OCR的项目。现在,我对这行代码有问题

    Dim ocr As New Ocr()
    Using bmp As New Bitmap("C:UsersBESToffshoreSERVICEDownloadsbanktest.png")
        MsgBox("asdsada")
        Dim tessocr As New tessnet2.Tesseract()
        'tessocr.Init(Nothing, "eng", False)
        'tessocr.GetThresholdedImage(bmp, Rectangle.Empty).Save("c:temp" & Guid.NewGuid().ToString() & ".bmp")
        '' Tessdata directory must be in the directory than this exe
        'Console.WriteLine("Multithread version")
        'ocr.DoOCRMultiThred(bmp, "eng")
        'Console.WriteLine("Normal version")
        'ocr.DoOCRNormal(bmp, "eng")
    End Using

给我一个错误的行是这样的
Dim tessocr As New tessnet2.Tesseract()如果我删除该行,消息框将显示。知道为什么会发生这种事吗?我添加了tessnet2引用,并且我在C#中得到了这段代码。

好的。我设法解决了这个问题。问题是:
1.我的目标是x86版本,而dll需要x64。通过将x86更改为Any CPU来解决此问题
2.它需要。Net Framework 2.0从4.0更改为2.0

您是否将Imports语句添加到此文件的顶部?

最新更新