我一直在关注本教程( http://note.sonots.com/SciSoftware/haartraining.html< /a> ) 进行一些 Haar 训练。我目前正致力于创建训练样本,特别是 .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.
发布评论
评论(3)
为了构建 mergevec,我发现最简单的方法是编辑 CMake 配置文件。在 OpenCV 2.3.1 中,
haartraining
目录位于modules/haartraining
中,而在 2.4.5 中,它位于apps/haartraining
中。无论哪种方式,您有兴趣编辑的文件名为CMakeLists.txt
。最简单的方法是为 mergevec 添加一个特殊部分,如下所示:
您可以将其添加到安装部分之前。然后将
mergevec.cpp
放入haartraining
目录中,正常构建OpenCV,您将得到一个opencv_mergevec
二进制文件,即mergevec。 cpp 可执行文件。
For building mergevec I found that the easiest way was to edit CMake configuration files. In OpenCV 2.3.1, the
haartraining
directory is inmodules/haartraining
whereas in 2.4.5 it is inapps/haartraining.
Either way, the file you are interested in editing is calledCMakeLists.txt
.The easiest thing to do is to add a special section for mergevec, as follows:
You can add this right before the installation section. Then place
mergevec.cpp
into thehaartraining
directory, build OpenCV normally, and you will have anopencv_mergevec
binary which is themergevec.cpp
executable.对于其他在 Ubuntu 上遇到此问题的人,请将标志移至调用末尾,如下所示:
For others struggling with this on Ubuntu, move the flags to the end of the invocation, like this:
要解决您的问题,请输入以下内容:
祝你好运
易卜拉欣
To fix your problem type the following:
Good Luck
Ibrahim