( box.height < 0 ){
box.y += box.height;
box.height *= -1;
}
gotBB = true; //已经获得bounding box
break;
}
}
void print_help(char** argv){
printf("use:\n %s -p /path/parameters.yml\n",argv[0]);
printf("-s source video\n-b bounding box file\n-tl track and learn\n-r repeat\n");
}
//分析运行程序时的命令行参数
void read_options(int argc, char** argv, VideoCapture& capture, FileStorage &fs){
for (int i=0;i<argc;i++){
if (strcmp(argv[i],"-b")==0){
if (argc>i){
readBB(argv[i+1]); //是否指定初始的bounding box
gotBB = true;
}
else
print_help(argv);
}
if (strcmp(argv[i],"-s")==0){ //从视频文件中读取
if (argc>i){
video = string(argv[i+1]);
capture.open(video);
fromfile = true;
}
else
print_help(argv);
}
//类似于格式到XML,Yahoo!标记语言(YML)提供了打开的功能
//应用安全,标准化。 您在HTML代码中包含YML标签
//的开放赢咖4平台。
if