fixed compile errors and warning on ubuntu64

This commit is contained in:
Maria Dimashova 2011-08-10 11:36:55 +00:00
parent 8bb9e4302e
commit 3569e18f0e
3 changed files with 19 additions and 19 deletions

View File

@ -251,7 +251,7 @@ static void findConstrainedCorrespondences(const Mat& _F,
if( dist < threshold ) if( dist < threshold )
break; break;
} }
if( i1 == keypoints1.size() ) if( i1 == (int)keypoints1.size() )
matches.push_back(Vec2i(i,bestIdx1)); matches.push_back(Vec2i(i,bestIdx1));
} }
} }

View File

@ -47,19 +47,19 @@ void onMouse( int event, int x, int y, int, void* )
void help() void help()
{ {
printf("\nThis is a demo that shows mean-shift based tracking\n" cout << "\nThis is a demo that shows mean-shift based tracking\n"
"You select a color objects such as your face and it tracks it.\n" "You select a color objects such as your face and it tracks it.\n"
"This reads from video camera (0 by default, or the camera number the user enters\n" "This reads from video camera (0 by default, or the camera number the user enters\n"
"Usage: \n" "Usage: \n"
" ./camshiftdemo [camera number]\n"); " ./camshiftdemo [camera number]\n";
printf("\n\nHot keys: \n" cout << "\n\nHot keys: \n"
"\tESC - quit the program\n" "\tESC - quit the program\n"
"\tc - stop the tracking\n" "\tc - stop the tracking\n"
"\tb - switch to/from backprojection view\n" "\tb - switch to/from backprojection view\n"
"\th - show/hide object histogram\n" "\th - show/hide object histogram\n"
"\tp - pause video\n" "\tp - pause video\n"
"To initialize tracking, select the object with mouse\n"); "To initialize tracking, select the object with mouse\n";
} }
const char* keys = const char* keys =
@ -85,8 +85,8 @@ int main( int argc, const char** argv )
if( !cap.isOpened() ) if( !cap.isOpened() )
{ {
help(); help();
printf("***Could not initialize capturing...***\n"); cout << "***Could not initialize capturing...***\n";
printf("Current parameter's value: \n"); cout << "Current parameter's value: \n";
parser.printParams(); parser.printParams();
return -1; return -1;
} }

View File

@ -2,19 +2,19 @@
#include "opencv2/highgui/highgui.hpp" #include "opencv2/highgui/highgui.hpp"
#include "opencv2/contrib/contrib.hpp" #include "opencv2/contrib/contrib.hpp"
#include <iostream>
using namespace cv; using namespace cv;
using namespace std; using namespace std;
void help() void help()
{ {
printf("\nThis program demonstrates Chamfer matching -- computing a distance between an \n" cout << "\nThis program demonstrates Chamfer matching -- computing a distance between an \n"
"edge template and a query edge image.\n" "edge template and a query edge image.\n"
"Usage: \n" "Usage: \n"
"./chamfer <image edge map> <template edge map>," "./chamfer <image edge map> <template edge map>,"
" By default the inputs are logo_in_clutter.png logo.png\n"); " By default the inputs are logo_in_clutter.png logo.png\n";
} }
const char* keys = const char* keys =
@ -35,10 +35,10 @@ int main( int argc, const char** argv )
Mat tpl = imread(templ.c_str(), 0); Mat tpl = imread(templ.c_str(), 0);
if (img.empty() || tpl.empty()) if (img.empty() || tpl.empty())
{ {
printf("Could not read image file %s or %s \n", image.c_str(), templ.c_str()); cout << "Could not read image file " << image << " or " << templ << "." << endl;
return -1; return -1;
} }
Mat cimg; Mat cimg;
cvtColor(img, cimg, CV_GRAY2BGR); cvtColor(img, cimg, CV_GRAY2BGR);
@ -54,7 +54,7 @@ int main( int argc, const char** argv )
int best = chamerMatching( img, tpl, results, costs ); int best = chamerMatching( img, tpl, results, costs );
if( best < 0 ) if( best < 0 )
{ {
printf("matching not found\n"); cout << "matching not found" << endl;
return -1; return -1;
} }