Tesseract5.0相对于旧版本的程序,识别精准度会提升不少,如下:
1、示例1:
图片:
结果:
2、示例2:
图片:
结果:
c++代码如下:
#include <iostream>
#include "tesseract/baseapi.h"
#include "allheaders.h"
#include <iostream>
#include "Coding.h"
int main(int argc, char* argv[])
{
tesseract::TessBaseAPI ocr;
int ret = ocr.Init("E:\\qt\\Project\\TesseractSample\\Debug\\tessdata", "chi_sim");
Pix* image = pixRead("C:\\Users\\Desktop\\11\\1.jpg");
ocr.SetImage(image);
char* outText = ocr.GetUTF8Text();
std::string strrrr = Coding::UTF8ToGB2312(outText);
std::cout << strrrr;
pixDestroy(&image);
delete[] outText;
ocr.End();
}