pull/29/head
Alex Leontiev 11 years ago
parent f080b3448f
commit 8869daec8c
  1. 14
      modules/tracking/samples/benchmark.cpp
  2. 6
      modules/tracking/samples/tracker.cpp
  3. 4
      modules/tracking/src/TLD.cpp
  4. 22
      modules/tracking/src/trackerTLD.cpp

@ -133,7 +133,7 @@ void print_table(char* videos[],int videoNum,char* algorithms[],int algNum,const
grid[0]=std::max(grid[0],(int)strlen(videos[i]));
}
for(int i=0;i<algNum;i++){
grid[i+1]=strlen(algorithms[i]);
grid[i+1]=(int)strlen(algorithms[i]);
for(int j=0;j<videoNum;j++)
grid[i+1]=std::max(grid[i+1],(int)strlen(results[j][i]));
}
@ -199,11 +199,11 @@ private:
};
AssessmentRes::AssessmentRes(int algnum):len(0),results(algnum){
for(int i=0;i<(int)results.size();i++){
if(!false){
#if !0
results[i].push_back(Ptr<Assessment>(new CorrectFrames(0.0)));
}else{
#else
results[i].push_back(Ptr<Assessment>(new CorrectFrames(0.5)));
}
#endif
results[i].push_back(Ptr<Assessment>(new PRF()));
}
}
@ -295,7 +295,7 @@ static AssessmentRes assessment(char* video,char* gt_str, char* algorithms[],cha
imshow( "Tracking API", image );
int frameCounter = 0;
AssessmentRes res(trackers.size());
AssessmentRes res((int)trackers.size());
for ( ;; ){
if( !paused ){
@ -330,13 +330,15 @@ static AssessmentRes assessment(char* video,char* gt_str, char* algorithms[],cha
rectangle( image, initBoxes[i], palette[i+1], 2, 1 );
}
if(!true && i==1){
#if !1
if(i==1){
printf("TLD\n");
printf("boundingBox=[%f,%f,%f,%f]\n",boundingBox.x,boundingBox.y,boundingBox.width,boundingBox.height);
printf("initBoxes[i]=[%f,%f,%f,%f]\n",initBoxes[i].x,initBoxes[i].y,initBoxes[i].width,initBoxes[i].height);
printf("overlap=%f\n",overlap(initBoxes[i],boundingBox));
exit(0);
}
#endif
for(int j=0;j<(int)res.results[i].size();j++)
res.results[i][j]->assess(boundingBox,initBoxes[i]);

@ -58,7 +58,7 @@ static void onMouse( int event, int x, int y, int, void* )
//draw the bounding box
Mat currentFrame;
image.copyTo( currentFrame );
rectangle( currentFrame, Point( boundingBox.x, boundingBox.y ), Point( x, y ), Scalar( 255, 0, 0 ), 2, 1 );
rectangle( currentFrame, Point((int) boundingBox.x, (int)boundingBox.y ), Point( x, y ), Scalar( 255, 0, 0 ), 2, 1 );
imshow( "Tracking API", currentFrame );
}
break;
@ -96,7 +96,7 @@ int main( int argc, char** argv ){
int coords[4]={0,0,0,0};
bool initBoxWasGivenInCommandLine=false;
do{
{
String initBoundingBox=parser.get<String>(3);
for(size_t npos=0,pos=0,ctr=0;ctr<4;ctr++){
npos=initBoundingBox.find_first_of(',',pos);
@ -119,7 +119,7 @@ int main( int argc, char** argv ){
if(coords[0]>0 && coords[1]>0 && coords[2]>0 && coords[3]>0){
initBoxWasGivenInCommandLine=true;
}
}while(0);
}
//open the capture
VideoCapture cap;

@ -199,8 +199,8 @@ double variance(Mat_<unsigned int>& intImgP,Mat_<unsigned int>& intImgP2,Rect bo
}
double NCC(Mat_<uchar> patch1,Mat_<uchar> patch2){
CV_Assert(patch1.rows=patch2.rows);
CV_Assert(patch1.cols=patch2.cols);
CV_Assert(patch1.rows==patch2.rows);
CV_Assert(patch1.cols==patch2.cols);
int N=patch1.rows*patch1.cols;
double s1=sum(patch1)(0),s2=sum(patch2)(0);

@ -772,8 +772,8 @@ Data::Data(Rect2d initBox){
printf("initial box has size %dx%d, while both dimensions should be no less than %d\n",(int)initBox.width,(int)initBox.height,20);
exit(EXIT_FAILURE);
}*/
minSize.width=initBox.width*20.0/minDim;
minSize.height=initBox.height*20.0/minDim;
minSize.width=(int)(initBox.width*20.0/minDim);
minSize.height=(int)(initBox.height*20.0/minDim);
frameNum=0;
printf("minSize= %dx%d\n",minSize.width,minSize.height);
}
@ -811,19 +811,19 @@ void MyMouseCallbackDEBUG::onMouse( int event, int x, int y){
detector_->computeIntegralImages(resized_img,intImgP,intImgP2);
int dx=initSize.width/10, dy=initSize.height/10,
i=x/scale/dx, j=y/scale/dy;
i=(int)(x/scale/dx), j=(int)(y/scale/dy);
fprintf(stdout,"patchVariance=%s\n",(detector_->patchVariance(intImgP,intImgP2,originalVariance,Point(dx*i,dy*j),initSize))?"true":"false");
fprintf(stdout,"p=%f\n",(detector_->ensembleClassifierNum(&blurred_img.at<uchar>(dy*j,dx*i),blurred_img.step[0])));
fprintf(stdout,"ensembleClassifier=%s\n",
(detector_->ensembleClassifier(&blurred_img.at<uchar>(dy*j,dx*i),blurred_img.step[0]))?"true":"false");
fprintf(stderr,"patchVariance=%s\n",(detector_->patchVariance(intImgP,intImgP2,originalVariance,Point(dx*i,dy*j),initSize))?"true":"false");
fprintf(stderr,"p=%f\n",(detector_->ensembleClassifierNum(&blurred_img.at<uchar>(dy*j,dx*i),(int)blurred_img.step[0])));
fprintf(stderr,"ensembleClassifier=%s\n",
(detector_->ensembleClassifier(&blurred_img.at<uchar>(dy*j,dx*i),(int)blurred_img.step[0]))?"true":"false");
resample(resized_img,Rect2d(Point(dx*i,dy*j),initSize),standardPatch);
tmp=tldModel->Sr(standardPatch);
fprintf(stdout,"Sr=%f\n",tmp);
fprintf(stdout,"isObject=%s\n",(tmp>THETA_NN)?"true":"false");
fprintf(stdout,"shouldBeIntegrated=%s\n",(abs(tmp-THETA_NN)<0.1)?"true":"false");
fprintf(stdout,"Sc=%f\n",tldModel->Sc(standardPatch));
fprintf(stderr,"Sr=%f\n",tmp);
fprintf(stderr,"isObject=%s\n",(tmp>THETA_NN)?"true":"false");
fprintf(stderr,"shouldBeIntegrated=%s\n",(abs(tmp-THETA_NN)<0.1)?"true":"false");
fprintf(stderr,"Sc=%f\n",tldModel->Sc(standardPatch));
rectangle(imgCanvas,Rect2d(Point2d(scale*dx*i,scale*dy*j),Size2d(initSize.width*scale,initSize.height*scale)), 0, 2, 1 );
imshow("picker",imgCanvas);

Loading…
Cancel
Save