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.
相关问题
- How to get the background from multiple images by
- Is shmid returned by shmget() unique across proces
- Why doesn't php sleep work in the windows-subs
- how to get running process information in java?
- Angular: ngc or tsc?
To fix your problem type the following:
Good Luck Ibrahim
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.For others struggling with this on Ubuntu, move the flags to the end of the invocation, like this: