【发布时间】:2011-12-27 11:12:19
【问题描述】:
我正在将 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 调用的准确性? 也许这里有一些建议! 最好的问候
托比亚斯
【问题讨论】: