0

I am now trying for several days to run this code ...

http://opencv.willowgarage.com/wiki/FaceDetection

... but without success.

1) I am using CentOS 6 64Bit on a VM with 2GHz and 1GB RAM.

2) I have tried it on several versions of the OS, even on different distros, till I finally found a package (I think it is 2.0.9 OpenCV for 64Bit), which has all needed software in it.

3) I installed everything, and compiled all samples in /samples/c with success using build_all.sh, only the facedetect.c and people...c. did not compiled. So I searched for an other facedetect code, and found the one in the link obove, and it did compile! But when trying to call the binary from the terminal, I got : "Segmentation Fault (Core Dumped)".

I have no clue about c++ (I am a PHP/JS Developer), and after some research, I found out, that the error has something to do with the code itself, and probably not with the environment.

I only need the coordinates of the face, the source is a normal image file and I am searching only for the "biggest" face (most dominant on the picture). So the code could be drastically reduced. Unfortunately, I have no clue about C++. I only need the coordinates of one face of a normal image, so that I can further process those coordinates with PHP.

Perhaps you have also an alternative code (C/C++/Pyhton ... doesnt matter). I have tried a native PHP implementation, but the data file is not as good as that of OpenCV.

Thanks in advance. :)

Danny Beckett
  • 20,529
  • 24
  • 107
  • 134
  • Just for clarification - have you compiled OpenCV yourself or you are working with binary package? – Andrey Kamaev Aug 25 '11 at 14:27
  • I have used this .rpm http://rpm.pbone.net/index.php3/stat/4/idpl/16618134/dir/centos_6/com/opencv-2.0.0-9.el6.x86_64.rpm.html I have compiled the the content of /samples/c/ , but installed OpenCV with the installer (not with cmake). The other samples work perfect, only the facedetect and peopledetect dont work (even with editing the paths in the code to e. g. highgui) – Michael Rosenliebe Aug 25 '11 at 14:42
  • Please also specify which cascade file you are using and check that you are able to open your video file/camera with any other OpenCV sample compiled with this package. – Andrey Kamaev Aug 25 '11 at 14:56
  • I am using the default cascade haarcascade_frontalface_alt.xml currently using only lena.jpg for testing. I also tried the manual installation with cmake 64Bit, but my CentOS unfortunately does not support "make", although it is installed. On CentOS 5.4, the manual installation works PERFECTLY (cmake/make/make install), but none of the samples work. Currently most samples work on CentOS 6, so I thought to myself to stick with this version. – Michael Rosenliebe Aug 25 '11 at 15:07

1 Answers1

1

I looked into this yesterday. (See OpenCV (CvHaarClassifierCascade*) cvLoad doesn't load , unable to load xml file.) It seems that the tutorial on the wiki isn't compatible with the current version of haarcascade_frontalface_alt_tree.xml. Try this OpenCV 2 tutorial instead.

Community
  • 1
  • 1
SSteve
  • 10,550
  • 5
  • 46
  • 72