Ask Your Question
0

How to compile the example "facerec_video.cpp"?

asked Oct 6 '14

Hello. I got some problems to compile the example "Face Recognition in Videos with OpenCV" (problem with facerec_video.cpp). The problem is that i don't understand where is the "include files"

#include "opencv2/core.hpp"
#include "opencv2/face.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/objdetect.hpp"

I installed opencv-2.4.9. Is this the problem? In /usr/local/include i found the opencv2 folder with all the header files. Really there was some differences: core.hpp was in opencv2/core/core.hpp, highgui.hpp in opencv2/highgui/highgui.hpp and so on but can't find face.hpp.

Help me please!

Preview: (hide)

Comments

hi andrei, put you entire code once then easy to found where is problem, and in your question there is ambiquity too..

2 answers

Sort by » oldest newest most voted
1

answered Oct 6 '14

berak gravatar image

updated Oct 6 '14

"I installed opencv-2.4.9. Is this the problem?" - yes, it seems the sample you're trying is for 3.0..

for 2.4.9, use(this example) and:

 #include "opencv2/contrib/contrib.hpp"

if you use 3.0, get the opencv_contrib repo, and

 #include "opencv2/face.hpp"
Preview: (hide)
0

answered Oct 13 '14

I solve the problem by making a clean up. The problem was that i installed opencv from repo and than from source (cmake/make/make install). So i solve by removing the 'form source version' of opencv.

To compile (facerec_video.cpp v2.4.9 here) i use opencv from repo and run:

g++ `pkg-config --cflags opencv` -o facerec_video facerec_video.cpp `pkg-config --libs opencv`

Thanks for help!

Preview: (hide)

Question Tools

Stats

Asked: Oct 6 '14

Seen: 2,001 times

Last updated: Oct 13 '14