不能编译mergevec.cpp从Haartraining教程 [英] Cannot compile mergevec.cpp from Haartraining tutorial

查看:261
本文介绍了不能编译mergevec.cpp从Haartraining教程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在遵循本教程( http://note.sonots.com/SciSoftware/haartraining.html)做一些哈尔训练。我目前坚持创建训练样本,特别是.vec文件的组合。我获得了这个( http://note.sonots.com/SciSoftware/haartraining/mergevec.cpp。 html )文件和如何为Linux(Ubuntu 11.04)构建它的描述。这里是我的问题,我无法构建mergevec代码。唯一的错误是致命错误:cvhaartraining.h:没有这样的文件或目录。我检查,以确保cvhaartraining.h与mergevec在同一目录,但发现一切正确的地方,我会期望它。

I have been following this tutorial ( http://note.sonots.com/SciSoftware/haartraining.html ) to do some Haar training. I am currently stuck on creating the training samples, specifically the combining of the .vec files. I am provided with this ( http://note.sonots.com/SciSoftware/haartraining/mergevec.cpp.html ) file and a description of how to build it for Linux (Ubuntu 11.04). Here lies my problem, I am unable to build the mergevec code. The only error is "fatal error: cvhaartraining.h: No such file or directory." I have checked to make sure that cvhaartraining.h is in the same directory as mergevec but have found everything to be right where I would expect it. At this point, I am at a loss of how to solve this, so any help would be greatly appreciated.

推荐答案

对于建筑物来说,这是一个很好的解决方案。 mergevec我发现最简单的方法是编辑CMake配置文件。在OpenCV 2.3.1中, haartraining 目录在 modules / haartraining 中,而在2.4.5中它在 apps / haartraining。无论哪种方式,您感兴趣编辑的文件称为 CMakeLists.txt

For building mergevec I found that the easiest way was to edit CMake configuration files. In OpenCV 2.3.1, the haartraining directory is in modules/haartraining whereas in 2.4.5 it is in apps/haartraining. Either way, the file you are interested in editing is called CMakeLists.txt.

最简单的做法是为mergevec添加一个特殊部分,如下所示:

The easiest thing to do is to add a special section for mergevec, as follows:

# -----------------------------------------------------------
#  mergevec
# -----------------------------------------------------------
add_executable(opencv_mergevec mergevec.cpp)
set_target_properties(opencv_mergevec PROPERTIES
                      DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
                      OUTPUT_NAME "opencv_mergevec")


$ b b

您可以在安装部分之前添加。然后将 mergevec.cpp 放入 haartraining 目录,正常构建OpenCV,您将有一个 opencv_mergevec binary是 mergevec.cpp 可执行文件。

You can add this right before the installation section. Then place mergevec.cpp into the haartraining directory, build OpenCV normally, and you will have an opencv_mergevec binary which is the mergevec.cpp executable.

这篇关于不能编译mergevec.cpp从Haartraining教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆