1 #include "opencv2/objdetect/objdetect.hpp"
2 #include "opencv2/highgui/highgui.hpp"
9 printf("\n This sample demonstrates cascade's convertation \n"
11 "./convert_cascade --size=\"<width>x<height>\"<convertation size> \n"
12 " input_cascade_path \n"
13 " output_cascade_filename\n"
15 "./convert_cascade --size=640x480 ../../opencv/data/haarcascades/haarcascade_eye.xml ../../opencv/data/haarcascades/test_cascade.xml \n"
19 int main( int argc, char** argv )
21 const char* size_opt = "--size=";
23 CvHaarClassifierCascade* cascade = 0;
28 if( argc != 4 || strncmp( argv[1], size_opt, strlen(size_opt) ) != 0 )
34 sscanf( argv[1], "--size=%ux%u", &size.width, &size.height );
35 cascade = cvLoadHaarClassifierCascade( argv[2], size );
39 fprintf( stderr, "Input cascade could not be found/opened\n" );
43 sprintf( comment, "Automatically converted from %s, window size = %dx%d", argv[2], size.width, size.height );
44 cvSave( argv[3], cascade, 0, comment, cvAttrList(0,0) );
49 main(1,"facedetect.c");