我正在为我正在编写的应用程序使用Tesseract OCR。我只是想从我时常得到的照片中识别出某些区域的文字。基本调用此刻工作高级使用Tesseract OCR
tesseract::TessBaseAPI api;
api.SetPageSegMode(tesseract::PSM_AUTO); // Segmentation on auto
api.Init("/usr/local/share/","eng"); // path = parent directory of tessdata
pFile = fopen("home/myname/test.bmp","r"); // Open picture
PIX* image; // Image format from leptonica
image = pixReadStreamBmp(pFile);
fclose(pFile);
api.SetImage(image); // Run the OCR
char* textOutput = new char[512];
textOutput =api.GetUTF8Text(); // Get the text
到目前为止,此代码工作正常。但是在某些时候,OCR并不像我希望的那样精确。实际上,我不想为我的目的培训一门新语言,所以我想知道是否有可能通过某些API调用提高准确度? 也许这里有一些建议! 问候
托比亚斯
如果你想要比这更精确,那么你可以在pixeRead()中传递OTSU阈值图像。我正在pixRead()中传递正常图像。通过OTSU阈值图像。我为此开发了算法。 。让我知道是否有人想要。 – 2016-06-24 07:44:43