- CvHaarClassifierCascade* cascade = load_object_detector(argv[1]);
-
- CvCapture* capture = cvCaptureFromCAM(CV_CAP_ANY);
- if(!capture) {
- cerr << "ERROR: capture is NULL " << endl;
- getchar();
- return -1;
+ int index, c;
+ opterr = 0;
+ const char *options = "vc:\x0";
+ while((c = getopt(argc, argv, options)) != -1)
+ {
+ switch(c)
+ {
+ case 'v': verbose = 1; break;
+ case 'c': cascade_filename = string(optarg); break;
+ case '?':
+ if(optopt == 'c')
+ {
+ printf("option -%c requires an argument.\n", optopt);
+ }
+ else if(isprint (optopt))
+ {
+ printf("unknown option `-%c'.\n", optopt);
+ }
+ else
+ {
+ printf("unknown option char `\\x%x'.\n", optopt);
+ }
+ break;
+ case '\x0': break; //ignore. not sure why this shows up. maybe zsh?
+ default: abort();
+ }