如何在Windows上的Cmake中使用Tesseract OCR?

问题描述 投票:3回答:2

我试图在Windows的cmake项目中使用tesseract。我安装了tesseract 5.0和tesseract 4.0。它们都没有cmake文件夹,因此行

find_package(Tesseract REQUIRED)

产生

CMake Error at CMakeLists.txt:14 (find_package):
  By not providing "FindTesseract.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "Tesseract", but CMake did not find one.

  Could not find a package configuration file provided by "Tesseract"
  (requested version 4.0) with any of the following names:

    TesseractConfig.cmake
    tesseract-config.cmake

  Add the installation prefix of "Tesseract" to CMAKE_PREFIX_PATH or set
  "Tesseract_DIR" to a directory containing one of the above files.  If
  "Tesseract" provides a separate development package or SDK, be sure it has
  been installed.

但是,在tesseract 5.0的安装文件夹中,有libtesseract-5.dll和许多其他文件。我可以在我的cmake项目中链接那些链接吗?如果是这样,怎么办?以及为什么安装文件夹中没有包含文件?我应该如何在项目中包含.h文件?

windows dll cmake shared-libraries tesseract
2个回答
0
投票

UB-Mannheim安装程序是自动工具构建,它只有tesseract的运行时部分(例如可执行文件和链接库)。您不能将其用于任何开发,因为它不提供所需的文件(库和头文件),因此缺少cmake文件是此安装的合理后果。您可以在安装程序完成的位置详细查看此信息。


0
投票

您是否尝试过使用tesseract的MSYS / Mingw版本:pacman -S mingw-w64-x86_64-tesseract-ocr,并使用mingw外壳中的cmake?这应该可以。

© www.soinside.com 2019 - 2024. All rights reserved.