OpenCV (Open Source Computer Vision) is a C++ library of programming functions which includes a lot of useful functions on image processing, computer vision, learning, etc.
You can get information and tutorials on The Wiki of OpenCV. (PS. Chinese version)
I have worked on the application of face detection, and have writtern a testing program which successfully detects the front-face from input image.
To execute the program, you should install OpenCV library first. Please follow the following steps.
- Download and install OpenCV. You can find a windows version here. Note that you need to reboot your computer after the OpenCV has been installed.
- The face detecting program written by me can be found here. It is a win32 console application, and written by VC6.0. You can execute this program by the following command:
face_detect.exe --cascade="haarcascade_frontalface_alt.xml" image.jpg
In this program, two parameters are required. The first is the front-face classifier. OpenCV had trained a front-face classifier and can be found in OpenCV/data/haarcascades. The second is the test image. - The results will show on the screen and the face image will be stored in the directory face/. (Please create the diretory face by yourself in the program path first.)
- You can also run the program by the following command:
face_detect.exe --cascade="haarcascade_frontalface_alt.xml" image.txt
You can list test image file names one per line in image.txt to do a batch process when you have a lot of test images. - The VC6.0 workspace of this program is here. I'm not familiar in C++, so the program is rough. You can enhance the code by yourself. For example, do face detection on all image files in a directory. (To compile this program, check the tutorial of using OpenCV with Visual C++ 6.0)
I hope that our team members can try and read this program soon. We can discuss the next steps such as collecting training and testing images, selecting features and training models to be utilized, etc. on Wed (5/9).
3 comments:
我剛剛試了一下,一張圖片有兩個人臉就抓不太出來XD。
可以把你寫的C++檔放出來嗎? 不然怎麼幫你改成讀整個資料夾的。
1.You can try another classifier which is named "haarcascade_frontalface_alt2.xml". The performance of face detection using this classifier is better than the previous one.
2.Please check the link at step 5. You can download my code there.
i get an error msg "OpenCV GUI Error Handler"
Unspecified error(The node does not represent a user object (unknown type?)) in function cvRead, .\cxpersistence.cpp(5061)
Post a Comment