Ask Your Question
1

command not found linux opencv

asked 2013-03-04 07:44:09 -0600

lovelf gravatar image

updated 2013-03-04 08:45:12 -0600

CvHaarClassifierCascade command not found

trying to execute

#include<stdio.h>
 #include<cv.h>
 #include<highgui.h>
 CvHaarClassifierCascade *cascade;
 CvMemStorage *Membuffer;
 void detectfaces(IplImage *frame)
 {
 int i;
 CvSeq *faces=cvHaarDetectObjects(frame,cascade,Membuffer,1.1,3,0,cvSize(30,30));//Maximum 3 neighbourhood images and the last cvsize gives minimum size of face
 for(i=0;i<(faces?faces->total:0);i++)
 {CvRect *r=(CvRect *)cvGetSeqElem(faces,i);
 cvRectangle(frame,cvPoint(r->x,r->y),cvPoint(r->x+r->width,r->y+r->height),CV_RGB(255,0,0),1,8,0);
 }
 }
 int main(int argc,char *argv[])
 {IplImage *frame;
 CvCapture *capture;
 int key;
 char filename[]="haarcascade_frontalface_alt.xml";
 cascade=(CvHaarClassifierCascade *)cvLoad(filename,0,0,0);
 Membuffer=cvCreateMemStorage(0);
 while(key!='q')
 {frame=cvQueryFrame(capture);
 if(!frame)
 break;
 frame->origin=0;
 detectfaces(frame);
 key=cvWaitKey(10);
 }
 cvReleaseCapture(&capture);
 cvDestroyWindow("Video");
 cvReleaseHaarClassifierCascade(&cascade);
 cvReleaseMemStorage(&Membuffer);
 }

also trying to execute installation samples from fodler c

other command not found errors pop up in putty ssh

What can I do, where might the problem be at?

 [root@ip-xxx c]# ./facedetect.c
 ./facedetect.c: line 5: CvHaarClassifierCascade: command not found
 ./facedetect.c: line 6: CvMemStorage: command not found
 ./facedetect.c: line 8: syntax error near unexpected token `('
 ./facedetect.c: line 8: `void detectfaces(IplImage *frame)'

Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-03-04 08:29:59 -0600

berak gravatar image

updated 2013-03-04 09:14:42 -0600

it's probably missing

#include<ml.h>

#include <opencv2/objdetect/objdetect.hpp> // CvHaarClassifierCascade is here

edit flag offensive delete link more

Comments

added it to the facedetect.c file but still get the same errors, posted the exact output from ssh

lovelf gravatar imagelovelf ( 2013-03-04 08:46:55 -0600 )edit

btw, putty ? you're remote debugging/programming ? you might need another idea of stopping the program than 'someone presssed q' ;)

berak gravatar imageberak ( 2013-03-04 09:21:45 -0600 )edit

also, you never initialize the capture ...

berak gravatar imageberak ( 2013-03-04 09:23:55 -0600 )edit

right, I just think the problem might be related to missing dependencies for opencv in CentOS, it's harder to find information for it that's related to installing OpenCV

lovelf gravatar imagelovelf ( 2013-03-04 09:52:44 -0600 )edit

Question Tools

Stats

Asked: 2013-03-04 07:44:09 -0600

Seen: 917 times

Last updated: Mar 04 '13