在tesseract中使用GetHOCRText(0)方法我能够在html中检索文本并在webview中呈现html我能够获得文本但图像中的文本位置与输出不同.任何想法都非常有帮助.
tesseract->SetInputName("word");
tesseract->SetOutputName("xyz");
tesseract->Recognize(NULL);
char *utf8Text=tesseract->GetHOCRText(0);
Run Code Online (Sandbox Code Playgroud)

并输出图像
GetBoxText()方法将返回数组中每个字符的确切位置。
char *boxtext = _tesseract->GetBoxText(0);
NSString* aBoxText = [NSString stringWithUTF8String:boxtext];
Run Code Online (Sandbox Code Playgroud)