Dobrí deň, prosím vás potreboval by som pomoc s programom. Trošku sa hrám s kamerou a potreboval by som aby bola prvá podmienka splnená a tá druhá nie. Ja som len začiatočník ale možno že vám to pôjde lepšie.Za radu vám vopred ďakujem.
// Create memory for calculations
static CvMemStorage* storage = 0;
// Create a new Haar classifier
static CvHaarClassifierCascade* cascade = 0;
// Create a string that contains the cascade name
const char* cascade_name =
//"haarcascade_frontalface_alt5.xml";
"haarcascade_eye.xml";
//"haarcascade_profileface.xml";
// Main function, defines the entry point for the program.
int main( int argc, char** argv )
{
// Structure for getting video from camera or avi
CvCapture* capture = 0;
// Used for calculations
int optlen = strlen("--cascade=");
// Input file name for avi or image file.
const char* input_name;
// Check for the correct usage of the command line
if( argc > 1 && strncmp( argv[1], "--cascade=", optlen ) == 0 )
{
cascade_name = argv[1] + optlen;
input_name = argc > 2 ? argv[2] : 0;
}
else
{
fprintf( stderr,"Usage: facedetect --cascade=\"<cascade_path>\"[filename|camera_index]\n" );
//return -2;
//input_name = argc > 1 ? argv[1] : 0;
}
// Load the HaarClassifierCascade
cascade = (CvHaarClassifierCascade*)cvLoad( cascade_name, 0, 0, 0 );
// Check whether the cascade has loaded successfully. Else report and error and quit
if( !cascade )
{
fprintf( stderr, "ERROR: Could not load classifier cascade\n" );
//return -1;
}
system("PAUSE");
return EXIT_SUCCESS;
}