run opencv demos int ubuntu

step1:copy demos and set rights

1 cd ~
2 mkdir openCV_samples
3 cp OpenCV-2.1.0/samples/c/* openCV_samples
4 cd openCV_samples/
5 chmod +x build_all.sh
6 ./build_all.sh

step2:Some of the training data for object detection is stored in /usr/local/share/opencv/haarcascades. You need to tell OpenCV which training data to use. I will use one of the frontal face detectors available. Let’s find a face:

1 ./facedetect --cascade="/usr/local/share/opencv/haarcascades/haarcascade_frontalface_alt.xml"--scale=1.5 lena.jpg

step3:Note the scale parameter. It allows you to increase or decrease the size of the smallest object found in the image (faces in this case). Smaller numbers allows OpenCV to find smaller faces, which may lead to increasing the number of false detections. Also, the computation time needed gets larger when searching for smaller objects.

posted @ 2012-04-15 15:59  windmissing  阅读(143)  评论(0编辑  收藏  举报