我试图运行此代码https://github.com/Itseez/opencv_contrib/blob/master/modules/text/samples/end_to_end_recognition.cpp
作为C++(VS12)中的项目,但我明白了
TIME_REGION_DETECTION = 21744.2
TIME_GROUPING = 1187.99
OCRTesseract(33): Tesseract not found.
TIME_OCR_INITIALIZATION = 2.85173
OCRTesseract(00): Tesseract not found.
OCR output = "" lenght = 0
OCRTesseract(00): Tesseract not found.
OCR output = "" lenght = 0
OCRTesseract(00): Tesseract not found.
OCR output = "" lenght = 0
OCRTesseract(00): Tesseract not found.
OCR output = "" lenght = 0
OCRTesseract(00): Tesseract not found.
OCR output = "" lenght = 0
TIME_OCR = 42.6972
最佳答案
这是因为在构建OpenCV之后安装了tessaract,在尝试使用CMake生成项目文件时,应确保OpenCV找到Tessaract。
1-安装第一个Tessaract:
该链接可能会有所帮助:http://emop.tamu.edu/Installing-Tesseract-Windows8
2-当尝试使用CMake生成Visual Studio时,应确保CMake找到Tessaract:
实际上,如果找不到它,则不会定义标志HAVE_TESSERACT
,因此,始终在尝试访问Tessarct引擎时,库opencv_text300.dll都会生成此消息OCRTesseract(33): Tesseract not found.
。您可以在此处查看行为:
https://github.com/Itseez/opencv_contrib/blob/master/modules/text/src/ocr_tesseract.cpp#L142
3-生成使用HAVE_TESSERACT
构建的正确的opencv_text300.dll。
4-执行可执行文件,以便程序正确运行。
关于c++ - OpenCV Tesseract,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33655610/