Tesseract + opencv 3.0 + windows, text module small size, linking errors

后端 未结 1 1745
情歌与酒
情歌与酒 2020-12-29 17:35

I posted this text two days ago in answers.opencv.org, now I\'m posting it here as well. http://answers.opencv.org/question/68634/text-contrib-module-and-tesseract/

相关标签:
1条回答
  • 2020-12-29 18:00

    I was facing the same problem. The solution I came up with was to edit the CMakeLists.txt file in text module.

    Replace

    if(${Tesseract_FOUND})
    include_directories(${Tesseract_INCLUDE_DIR})
    endif()
    

    with

    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/
                    )   
    

    When you run Cmake, Tesseract will still be no and the Tessaract/Lept libraries should be empty.

    0 讨论(0)
提交回复
热议问题