简体   繁体   English

错误编译opencv示例

[英]error compiling opencv example

I am trying to compile an example that is provided for one of the opencv_contrib modules (text detection module). 我正在尝试编译为opencv_contrib模块之一(文本检测模块)提供的示例。 The link is below: https://github.com/Balaje/opencv-1/blob/master/samples/cpp/textdetection.cpp 链接在下面: https : //github.com/Balaje/opencv-1/blob/master/samples/cpp/textdetection.cpp

I keep getting errors like: error: 'ERStat' was not declared in this scope 我不断收到如下错误:错误:未在此范围内声明“ ERStat”

I have already compiled and installed opencv_contrib modules and I see text.hpp in /usr/local/include/opencv2. 我已经编译并安装了opencv_contrib模块,并且在/ usr / local / include / opencv2中看到了text.hpp。 I included text.hpp as well, but I got the same errors. 我也包括了text.hpp,但是出现了同样的错误。 Does anybody know how I can fix the problem? 有人知道我该如何解决这个问题?

I compile the file with the following command: 我使用以下命令编译文件:
g++ pkg-config --cflags opencv -o textdetection textdetecti on.cpp pkg-config --libs opencv g ++ pkg-config --cflags opencv -o textdetection textdetecti on.cpp pkg-config --libs opencv

Try replacing all ERStat in the code with cv::text::ERStat . 尝试更换所有ERStat与代码中cv::text::ERStat It should solve the problem. 它应该解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM