Tesseract opencv 3.0 windows,文本模块体积小,链接错误

我两天前在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(07001) 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:是的.问题是我没有找到链接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

当然,当我将文本模块链接到我的程序时,它会给我链接错误.

链接错误如下所示:opencv_text300d.lib(ocr_tesseract.obj):错误LNK2019:未解析的外部符号“public:bool __cdecl tesseract :: PageIterator :: BoundingBox(enum tesseract :: PageIteratorLevel,int *,int *)const“(?……………………

...
#include "opencv2/text.hpp"
...
string output;
cv::Mat aux;
Ptr<OCRTesseract> ocr = OCRTesseract::create();
ocr->run(aux,output);
...

显然,我已经使用其他包含目录,链接器附加库目录以及向文本模块输入其他依赖项来设置我的项目.

真的,非常感谢你的进步.

我遇到了同样的问题.我想出的解决方案是在文本模块中编辑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仍然是no,TesSaract / Lept库应为空.

相关文章

Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...
Windows文件操作基础代码 Windows下对文件进行操作使用的一段...
Winpcap基础代码 使用Winpcap进行网络数据的截获和发送都需要...
使用vbs脚本进行批量编码转换 最近需要使用SourceInsight查看...