⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cascadefileparser.cc

📁 tracciatore di mani con webcam
💻 CC
📖 第 1 页 / 共 4 页
字号:
    throw ITException("cascade type tree not supported yet");  }    break;  case 11:#line 294 "CascadeFileParser.yy"    { yyval.bval = false; }    break;  case 12:#line 295 "CascadeFileParser.yy"    { yyval.bval = true; }    break;  case 15:#line 305 "CascadeFileParser.yy"    {  }    break;  case 16:#line 309 "CascadeFileParser.yy"    {    curr_branch = yyvsp[-12].ival;    if (curr_branch<0 || curr_branch>=(int)pCascade->m_branch_classifiers.size()) {      throw ITException("branch number out of range");    }    pCascade->m_branch_names[yyvsp[-12].ival] = yyIDstring; // $4;    pCascade->m_branch_false_positive_rates[yyvsp[-12].ival] = yyvsp[-5].fval;    pCascade->m_branch_detection_rates[yyvsp[-12].ival] = yyvsp[-1].fval;  }    break;  case 17:#line 323 "CascadeFileParser.yy"    {    int declared_num_strong_clsf = yyvsp[-1].ival;    if (declared_num_strong_clsf          !=pCascade->GetNumStrongClassifiers(curr_branch))    {      char buf[1024];      sprintf(buf, "instead of %d strong classifiers as declared, "                   "%d were found (branch %d)",              declared_num_strong_clsf,              pCascade->GetNumStrongClassifiers(curr_branch),              curr_branch);      throw ITException(buf);    }  }    break;  case 18:#line 341 "CascadeFileParser.yy"    {    yyval.ival = yyvsp[-3].ival;  }    break;  case 21:#line 354 "CascadeFileParser.yy"    {    int delared_num_weak = yyvsp[-1].ival;    if (delared_num_weak!=curr_strong->GetNumWeakClassifiers()) {      char buf[1024];      sprintf(buf, "declared %d weak classifiers, found %d",              delared_num_weak, curr_strong->GetNumWeakClassifiers());      throw ITException(buf);    }  }    break;  case 22:#line 369 "CascadeFileParser.yy"    {    int declared_id = yyvsp[-17].ival;    int branch_offset = 0;    if (curr_branch!=-1) {       branch_offset = pCascade->GetNumStrongClassifiers();    }    if (declared_id-branch_offset          !=pCascade->GetNumStrongClassifiers(curr_branch))    {      char buf[1024];      sprintf(buf, "expected strong classifier number %d, found number %d (branch %d)",              pCascade->GetNumStrongClassifiers(), yyvsp[-17].ival, curr_branch);      throw ITException(buf);    }    curr_strong = &pCascade->AddStrongClassifier(curr_branch, yyvsp[-13].fval, yyvsp[-9].fval);    curr_strong->SetAlphasThreshold(yyvsp[-1].fval);    yyval.ival = yyvsp[-6].ival;  }    break;  case 25:#line 396 "CascadeFileParser.yy"    {    curr_strong->AddWeakClassifier(yyvsp[0].pWC, yyvsp[-2].fval);    delete yyvsp[0].pWC;  }    break;  case 26:#line 405 "CascadeFileParser.yy"    {    if (parse_entire_cascade) {      yyval.pWC = new CWeakClassifier(yyvsp[-6].pIF, yyvsp[-4].bval, yyvsp[-3].fval, yyvsp[-1].fval);    } else {      parsed_weak = new CWeakClassifier(yyvsp[-6].pIF, yyvsp[-4].bval, yyvsp[-3].fval, yyvsp[-1].fval);    }  }    break;  case 27:#line 415 "CascadeFileParser.yy"    { yyval.bval = true; }    break;  case 28:#line 416 "CascadeFileParser.yy"    { yyval.bval = false; }    break;  case 29:#line 420 "CascadeFileParser.yy"    { yyval.pIF = NULL; }    break;  case 30:#line 424 "CascadeFileParser.yy"    { yyval.pIF = new CLeftRightIF(image_width, image_height,                          yyvsp[-8].ival, yyvsp[-6].ival, yyvsp[-4].ival, yyvsp[-2].ival, yyvsp[0].ival);  }    break;  case 31:#line 430 "CascadeFileParser.yy"    { yyval.pIF = new CUpDownIF(image_width, image_height,                       yyvsp[-8].ival, yyvsp[-6].ival, yyvsp[-4].ival, yyvsp[-2].ival, yyvsp[0].ival);  }    break;  case 32:#line 436 "CascadeFileParser.yy"    { yyval.pIF = new CLeftCenterRightIF(image_width, image_height,                                yyvsp[-10].ival, yyvsp[-8].ival, yyvsp[-6].ival, yyvsp[-4].ival, yyvsp[-2].ival, yyvsp[0].ival);  }    break;  case 33:#line 443 "CascadeFileParser.yy"    { yyval.pIF = new CSevenColumnsIF(image_width, image_height,                             yyvsp[-18].ival, yyvsp[-16].ival, yyvsp[-14].ival, yyvsp[-12].ival, yyvsp[-10].ival, yyvsp[-8].ival, yyvsp[-6].ival, yyvsp[-4].ival, yyvsp[-2].ival, yyvsp[0].ival);  }    break;  case 34:#line 449 "CascadeFileParser.yy"    { yyval.pIF = new CDiagIF(image_width, image_height,                     yyvsp[-10].ival, yyvsp[-8].ival, yyvsp[-6].ival, yyvsp[-4].ival, yyvsp[-2].ival, yyvsp[0].ival);  }    break;  case 35:#line 455 "CascadeFileParser.yy"    { yyval.pIF = new CLeftRightSameIF(image_width, image_height,                              yyvsp[-8].ival, yyvsp[-6].ival, yyvsp[-4].ival, yyvsp[-2].ival, yyvsp[0].ival);  }    break;  case 36:#line 461 "CascadeFileParser.yy"    { yyval.pIF = new CUpDownSameIF(image_width, image_height,                           yyvsp[-8].ival, yyvsp[-6].ival, yyvsp[-4].ival, yyvsp[-2].ival, yyvsp[0].ival);  }    break;  case 37:#line 467 "CascadeFileParser.yy"    { yyval.pIF = new CLeftCenterRightSameIF(image_width, image_height,                                    yyvsp[-10].ival, yyvsp[-8].ival, yyvsp[-6].ival, yyvsp[-4].ival, yyvsp[-2].ival, yyvsp[0].ival);  }    break;  case 38:#line 474 "CascadeFileParser.yy"    { yyval.pIF = new CSevenColumnsSameIF(image_width, image_height,                                 yyvsp[-18].ival, yyvsp[-16].ival,                                 yyvsp[-14].ival, yyvsp[-12].ival, yyvsp[-10].ival, yyvsp[-8].ival, yyvsp[-6].ival, yyvsp[-4].ival, yyvsp[-2].ival, yyvsp[0].ival);  }    break;  case 39:#line 482 "CascadeFileParser.yy"    { yyval.pIF = new CSevenColumnsSimilarIF(image_width, image_height,                                    yyvsp[-18].ival, yyvsp[-16].ival,                                    yyvsp[-14].ival, yyvsp[-12].ival, yyvsp[-10].ival, yyvsp[-8].ival, yyvsp[-6].ival, yyvsp[-4].ival, yyvsp[-2].ival, yyvsp[0].ival);  }    break;  case 40:#line 489 "CascadeFileParser.yy"    { yyval.pIF = new CDiagSameIF(image_width, image_height,                         yyvsp[-10].ival, yyvsp[-8].ival, yyvsp[-6].ival, yyvsp[-4].ival, yyvsp[-2].ival, yyvsp[0].ival);  }    break;  case 41:#line 495 "CascadeFileParser.yy"    { yyval.pIF = new CDiagSimilarIF(image_width, image_height,                            yyvsp[-10].ival, yyvsp[-8].ival, yyvsp[-6].ival, yyvsp[-4].ival, yyvsp[-2].ival, yyvsp[0].ival);  }    break;  case 42:#line 501 "CascadeFileParser.yy"    {    yyval.pIF = new CFourBoxesIF(image_width, image_height,                          yyvsp[-6].pRect, yyvsp[-4].pRect, yyvsp[-2].pRect, yyvsp[0].pRect);    delete yyvsp[-6].pRect;    delete yyvsp[-4].pRect;    delete yyvsp[-2].pRect;    delete yyvsp[0].pRect;  }    break;  case 43:#line 512 "CascadeFileParser.yy"    {    yyval.pIF = new CFourBoxesSameIF(image_width, image_height,                              yyvsp[-6].pRect, yyvsp[-4].pRect, yyvsp[-2].pRect, yyvsp[0].pRect);    delete yyvsp[-6].pRect;    delete yyvsp[-4].pRect;    delete yyvsp[-2].pRect;    delete yyvsp[0].pRect;  }    break;  case 44:#line 525 "CascadeFileParser.yy"    { yyval.pRect = new CRect(yyvsp[-7].ival, yyvsp[-5].ival, yyvsp[-3].ival, yyvsp[-1].ival); }    break;  case 45:#line 529 "CascadeFileParser.yy"    { yyval.fval = yyvsp[0].fval; }    break;  case 46:#line 530 "CascadeFileParser.yy"    { yyval.fval = (double) yyvsp[0].ival; }    break;    }/* Line 1000 of yacc.c.  */#line 1710 "CascadeFileParser.cc"  yyvsp -= yylen;  yyssp -= yylen;  YY_STACK_PRINT (yyss, yyssp);  *++yyvsp = yyval;  /* Now `shift' the result of the reduction.  Determine what state     that goes to, based on the state we popped back to and the rule     number reduced by.  */  yyn = yyr1[yyn];  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)    yystate = yytable[yystate];  else    yystate = yydefgoto[yyn - YYNTOKENS];  goto yynewstate;/*------------------------------------.| yyerrlab -- here on detecting error |`------------------------------------*/yyerrlab:  /* If not already recovering from an error, report this error.  */  if (!yyerrstatus)    {      ++yynerrs;#if YYERROR_VERBOSE      yyn = yypact[yystate];      if (YYPACT_NINF < yyn && yyn < YYLAST)	{	  YYSIZE_T yysize = 0;	  int yytype = YYTRANSLATE (yychar);	  const char* yyprefix;	  char *yymsg;	  int yyx;	  /* Start YYX at -YYN if negative to avoid negative indexes in	     YYCHECK.  */	  int yyxbegin = yyn < 0 ? -yyn : 0;	  /* Stay within bounds of both yycheck and yytname.  */	  int yychecklim = YYLAST - yyn;	  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;	  int yycount = 0;	  yyprefix = ", expecting ";	  for (yyx = yyxbegin; yyx < yyxend; ++yyx)	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)	      {		yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);		yycount += 1;		if (yycount == 5)		  {		    yysize = 0;		    break;		  }	      }	  yysize += (sizeof ("syntax error, unexpected ")		     + yystrlen (yytname[yytype]));	  yymsg = (char *) YYSTACK_ALLOC (yysize);	  if (yymsg != 0)	    {	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");	      yyp = yystpcpy (yyp, yytname[yytype]);	      if (yycount < 5)		{		  yyprefix = ", expecting ";		  for (yyx = yyxbegin; yyx < yyxend; ++yyx)		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)		      {			yyp = yystpcpy (yyp, yyprefix);			yyp = yystpcpy (yyp, yytname[yyx]);			yyprefix = " or ";		      }		}	      yyerror (yymsg);	      YYSTACK_FREE (yymsg);	    }	  else	    yyerror ("syntax error; also virtual memory exhausted");	}      else#endif /* YYERROR_VERBOSE */	yyerror ("syntax error");    }  if (yyerrstatus == 3)    {      /* If just tried and failed to reuse lookahead token after an	 error, discard it.  */      if (yychar <= YYEOF)        {          /* If at end of input, pop the error token,	     then the rest of the stack, then return failure.  */	  if (yychar == YYEOF)	     for (;;)	       {		 YYPOPSTACK;		 if (yyssp == yyss)		   YYABORT;		 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);		 yydestruct (yystos[*yyssp], yyvsp);	       }        }      else	{	  YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);	  yydestruct (yytoken, &yylval);	  yychar = YYEMPTY;	}    }  /* Else will try to reuse lookahead token after shifting the error     token.  */  goto yyerrlab1;/*---------------------------------------------------.| yyerrorlab -- error raised explicitly by YYERROR.  |`---------------------------------------------------*/yyerrorlab:#ifdef __GNUC__  /* Pacify GCC when the user code never invokes YYERROR and the label     yyerrorlab therefore never appears in user code.  */  if (0)     goto yyerrorlab;#endif  yyvsp -= yylen;  yyssp -= yylen;  yystate = *yyssp;  goto yyerrlab1;/*-------------------------------------------------------------.| yyerrlab1 -- common code for both syntax error and YYERROR.  |`-------------------------------------------------------------*/yyerrlab1:  yyerrstatus = 3;	/* Each real token shifted decrements this.  */  for (;;)    {      yyn = yypact[yystate];      if (yyn != YYPACT_NINF)	{	  yyn += YYTERROR;	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)	    {	      yyn = yytable[yyn];	      if (0 < yyn)		break;	    }	}      /* Pop the current state because it cannot handle the error token.  */      if (yyssp == yyss)	YYABORT;      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);      yydestruct (yystos[yystate], yyvsp);      YYPOPSTACK;      yystate = *yyssp;      YY_STACK_PRINT (yyss, yyssp);    }  if (yyn == YYFINAL)    YYACCEPT;  YYDPRINTF ((stderr, "Shifting error token, "));  *++yyvsp = yylval;  yystate = yyn;  goto yynewstate;/*-------------------------------------.| yyacceptlab -- YYACCEPT comes here.  |`-------------------------------------*/yyacceptlab:  yyresult = 0;  goto yyreturn;/*-----------------------------------.| yyabortlab -- YYABORT comes here.  |`-----------------------------------*/yyabortlab:  yyresult = 1;  goto yyreturn;#ifndef yyoverflow/*----------------------------------------------.| yyoverflowlab -- parser overflow comes here.  |`----------------------------------------------*/yyoverflowlab:  yyerror ("parser stack overflow");  yyresult = 2;  /* Fall through.  */#endifyyreturn:#ifndef yyoverflow  if (yyss != yyssa)    YYSTACK_FREE (yyss);#endif  return yyresult;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -