fixed compile errors and warning on ubuntu64
authorMaria Dimashova <no@email>
Wed, 10 Aug 2011 11:36:55 +0000 (11:36 +0000)
committerMaria Dimashova <no@email>
Wed, 10 Aug 2011 11:36:55 +0000 (11:36 +0000)
samples/cpp/build3dmodel.cpp
samples/cpp/camshiftdemo.cpp
samples/cpp/chamfer.cpp

index 5ef25f4..081c9db 100644 (file)
@@ -251,7 +251,7 @@ static void findConstrainedCorrespondences(const Mat& _F,
                 if( dist < threshold )
                     break;
             }
-            if( i1 == keypoints1.size() )
+            if( i1 == (int)keypoints1.size() )
                 matches.push_back(Vec2i(i,bestIdx1));
         }
     }
index b726643..921ac9e 100644 (file)
@@ -47,19 +47,19 @@ void onMouse( int event, int x, int y, int, void* )
 
 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 = 
@@ -85,8 +85,8 @@ int main( int argc, const char** argv )
     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;
     }
index 062873d..2c03d3d 100644 (file)
@@ -2,19 +2,19 @@
 #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 = 
@@ -35,10 +35,10 @@ int main( int argc, const char** argv )
        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);
 
@@ -54,7 +54,7 @@ int main( int argc, const char** argv )
     int best = chamerMatching( img, tpl, results, costs );
     if( best < 0 )
     {
-        printf("matching not found\n");
+        cout << "matching not found" << endl;
         return -1;
     }