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"
"This reads from video camera (0 by default, or the camera number the user enters\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"
"\tc - stop the tracking\n"
"\tb - switch to/from backprojection view\n"
"\th - show/hide object histogram\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 =
if( !cap.isOpened() )
{
help();
- printf("***Could not initialize capturing...***\n");
- printf("Current parameter's value: \n");
+ cout << "***Could not initialize capturing...***\n";
+ cout << "Current parameter's value: \n";
parser.printParams();
return -1;
}
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/contrib/contrib.hpp"
+#include <iostream>
+
using namespace cv;
using namespace std;
void help()
{
- printf("\nThis program demonstrates Chamfer matching -- computing a distance between an \n"
- "edge template and a query edge image.\n"
- "Usage: \n"
- "./chamfer <image edge map> <template edge map>,"
- " By default the inputs are logo_in_clutter.png logo.png\n");
-
-
+ cout << "\nThis program demonstrates Chamfer matching -- computing a distance between an \n"
+ "edge template and a query edge image.\n"
+ "Usage: \n"
+ "./chamfer <image edge map> <template edge map>,"
+ " By default the inputs are logo_in_clutter.png logo.png\n";
}
const char* keys =
Mat tpl = imread(templ.c_str(), 0);
if (img.empty() || tpl.empty())
- {
- printf("Could not read image file %s or %s \n", image.c_str(), templ.c_str());
- return -1;
- }
+ {
+ cout << "Could not read image file " << image << " or " << templ << "." << endl;
+ return -1;
+ }
Mat cimg;
cvtColor(img, cimg, CV_GRAY2BGR);
int best = chamerMatching( img, tpl, results, costs );
if( best < 0 )
{
- printf("matching not found\n");
+ cout << "matching not found" << endl;
return -1;
}