CMake for Tesseract和OpenCV

 个信2602881723 发布于 2023-02-12 19:36

我是Linux编程的新手,我正在尝试Ubuntu 12.10使用Tesseract和OpenCV创建一个OCR应用程序.到目前为止,我已经设置tesseractOpenCV在Linux上也遵循了本教程,在本教程中,我发现很容易创建一个文件CMakeList.txt并在其中链接OpenCV.

现在我正在尝试tesseract-ocr使用此代码编译库.据我所知,我没有在tesseract-ocr我的代码之间建立链接,这就是为什么我有错误.

我想要和搜索的是我是否可以在一个文件中链接TesseractOpenCV使用CMake,如果可能的话.一个教程会很好,因为我对Linux是全新的.提前致谢

1 个回答
  • 我写了的CMakeLists.txt这样

    cmake_minimum_required (VERSION 2.6)
    project (test-ocr)
    
    # Add the including directory of the tesseract 
    # and please replace with your dir.
    include_directories (/home/ytxie/include)
    # Add the search directory for the tesseract library 
    # and please replace with your dir.
    link_directories (/home/ytxie/lib)
    
    add_executable (test-ocr test.cpp)
    
    # link the leptonica library and the tesseract library
    target_link_libraries (test-ocr lept tesseract)
    

    我添加了评论,似乎很容易理解.该TEST.CPP只是该示例代码.

    如果您想将OpenCV相关设置添加到此cmake文件中,只需添加它们即可.如果有一些令人困惑的事情,请阅读CMake的文件.

    注意:要使test-ocr成功运行,您应下载英文数据并将其内容复制到/ share/tessdata中.

    2023-02-12 19:40 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有