Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以使用 tesseract 异步从图像中获取文本?如果扫描需要很长时间,我很乐意让用户取消扫描。
char* utf8Text = tesseract->GetUTF8Text();
锁定屏幕直到 OCR 完成。
在后台线程中运行将使用户界面继续接收请求。尝试这样的事情:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ char* utf8Text = tesseract->GetUTF8Text(); });