Tesseract + opencv 3.0 + windows,文本模块体积小,链接错误
Tesseract + opencv 3.0 + windows, text module small size, linking errors
我两天前在 answers.opencv.org 上发布了这篇文章,现在我也将它发布在这里。 http://answers.opencv.org/question/68634/text-contrib-module-and-tesseract/
Good afternoon to everyone. First of all, sorry for my english hehe.
I've been trying to build the opencv contrib module 'text', however I
haven't got sucess. Note: Other modules like xfeatures2d have never
given me a problem.
My platform is windows 7 x64 and I use VS2013 as compiler, I've
followed this
tutorial(http://vorba.ch/2014/tesseract-3.03-vs2013.html) in order to
build Tesseract 3.04 as LIB, but after compiling it succesfully, I
want to generate the vproj with cmake and the problem is the
following:
In CMake GUI, having previously selected opencv source, EXTRAS
directory, etc etc, I don't get the vars under 'Tesseract' group set
correcly (INCLUDE AND LIBS). I know it because when I click on
configure, The log says "Tesseract: NO".
I've inspected the FindTesseract cmake script and I think that it
doesn't work....
Please, anyone could give me a little clue about what's happening? How
can I build the opencv text module to use Tesseract functions?
Also I've tried to compile text module adding link paths to Tesseract
but when I want to use in my program I get link errors about undefined
symbols...
This situation is taking me serveral days bothering me. Are there
someone who is using text module under windows?
没有人可以帮助我吗?我取得了一些进展,现在 cmake GUI,我说 Tesseract:Yes。问题是我没有找到 linking leptonica lib 的条目,它不在同一个 Tesseract 组中,而是在 'Ungrouped Entries'.
中
好的,现在问题仍然存在,cmake 创建的 VS 解决方案没有正确构建文本模块,正如我所见,Lept lib 大约 9Mb,TesseractLib 大约 128Mb(在 /MT 和调试中),但是 opencv_text300d.lib只有12Mb。出了点问题....
我不确定我必须使用哪个 tesseract 版本。我试过两种组合:
liblept168-static-mtdll-debug.lib + libtesseract302-static-debug.lib
和
liblept171-static-mtdll-debug.lib + libtesseract304-static-debug.lib
当然,当我 link 文本模块到我的程序时,它给我 link 错误。
linking 错误看起来像:opencv_text300d.lib(ocr_tesseract.obj):错误 LNK2019: unresolved external symbol "public: bool __cdecl tesseract::PageIterator::BoundingBox(enum tesseract::PageIteratorLevel,int *,int *,int *,int *)const " (?........................
...
#include "opencv2/text.hpp"
...
string output;
cv::Mat aux;
Ptr<OCRTesseract> ocr = OCRTesseract::create();
ocr->run(aux, output);
...
显然,我已经使用额外的包含目录、linker 额外的库目录和向文本模块输入额外的依赖项来设置我的项目。
真的,非常感谢你。
我遇到了同样的问题。我想到的解决方案是编辑文本模块中的 CMakeLists.txt 文件。
替换
if(${Tesseract_FOUND})
include_directories(${Tesseract_INCLUDE_DIR})
endif()
和
add_definitions( -DWINDOWS)
add_definitions( -DNOMINMAX)
SET(Tesseract_DIR "C:\tesseract-build\tesseract-ocr")
SET(Lept_DIR "C:\tesseract-build\lib")
include_directories(
${Tesseract_DIR}/api
${Tesseract_DIR}/ccutil/
${Tesseract_DIR}/ccstruct/
${Tesseract_DIR}/ccmain/
)
link_directories( ${Tesseract_DIR}/vs2013/bin/Win32/DLL_Release/
${Lept_DIR}/
${Lept_DIR}/Win32/
)
当你 运行 Cmake 时,Tesseract 仍然没有,Tessaract/Lept 库应该是空的。
我两天前在 answers.opencv.org 上发布了这篇文章,现在我也将它发布在这里。 http://answers.opencv.org/question/68634/text-contrib-module-and-tesseract/
Good afternoon to everyone. First of all, sorry for my english hehe. I've been trying to build the opencv contrib module 'text', however I haven't got sucess. Note: Other modules like xfeatures2d have never given me a problem.
My platform is windows 7 x64 and I use VS2013 as compiler, I've followed this tutorial(http://vorba.ch/2014/tesseract-3.03-vs2013.html) in order to build Tesseract 3.04 as LIB, but after compiling it succesfully, I want to generate the vproj with cmake and the problem is the following:
In CMake GUI, having previously selected opencv source, EXTRAS directory, etc etc, I don't get the vars under 'Tesseract' group set correcly (INCLUDE AND LIBS). I know it because when I click on configure, The log says "Tesseract: NO".
I've inspected the FindTesseract cmake script and I think that it doesn't work....
Please, anyone could give me a little clue about what's happening? How can I build the opencv text module to use Tesseract functions?
Also I've tried to compile text module adding link paths to Tesseract but when I want to use in my program I get link errors about undefined symbols...
This situation is taking me serveral days bothering me. Are there someone who is using text module under windows?
没有人可以帮助我吗?我取得了一些进展,现在 cmake GUI,我说 Tesseract:Yes。问题是我没有找到 linking leptonica lib 的条目,它不在同一个 Tesseract 组中,而是在 'Ungrouped Entries'.
中好的,现在问题仍然存在,cmake 创建的 VS 解决方案没有正确构建文本模块,正如我所见,Lept lib 大约 9Mb,TesseractLib 大约 128Mb(在 /MT 和调试中),但是 opencv_text300d.lib只有12Mb。出了点问题....
我不确定我必须使用哪个 tesseract 版本。我试过两种组合: liblept168-static-mtdll-debug.lib + libtesseract302-static-debug.lib 和 liblept171-static-mtdll-debug.lib + libtesseract304-static-debug.lib
当然,当我 link 文本模块到我的程序时,它给我 link 错误。
linking 错误看起来像:opencv_text300d.lib(ocr_tesseract.obj):错误 LNK2019: unresolved external symbol "public: bool __cdecl tesseract::PageIterator::BoundingBox(enum tesseract::PageIteratorLevel,int *,int *,int *,int *)const " (?........................
...
#include "opencv2/text.hpp"
...
string output;
cv::Mat aux;
Ptr<OCRTesseract> ocr = OCRTesseract::create();
ocr->run(aux, output);
...
显然,我已经使用额外的包含目录、linker 额外的库目录和向文本模块输入额外的依赖项来设置我的项目。
真的,非常感谢你。
我遇到了同样的问题。我想到的解决方案是编辑文本模块中的 CMakeLists.txt 文件。
替换
if(${Tesseract_FOUND})
include_directories(${Tesseract_INCLUDE_DIR})
endif()
和
add_definitions( -DWINDOWS)
add_definitions( -DNOMINMAX)
SET(Tesseract_DIR "C:\tesseract-build\tesseract-ocr")
SET(Lept_DIR "C:\tesseract-build\lib")
include_directories(
${Tesseract_DIR}/api
${Tesseract_DIR}/ccutil/
${Tesseract_DIR}/ccstruct/
${Tesseract_DIR}/ccmain/
)
link_directories( ${Tesseract_DIR}/vs2013/bin/Win32/DLL_Release/
${Lept_DIR}/
${Lept_DIR}/Win32/
)
当你 运行 Cmake 时,Tesseract 仍然没有,Tessaract/Lept 库应该是空的。