more warnings fixed. +some warnings in examples
authorAnatoly Baksheev <no@email>
Sat, 7 May 2011 12:06:58 +0000 (12:06 +0000)
committerAnatoly Baksheev <no@email>
Sat, 7 May 2011 12:06:58 +0000 (12:06 +0000)
12 files changed:
modules/calib3d/src/calibinit.cpp
modules/ml/src/svm.cpp
samples/c/adaptiveskindetector.cpp
samples/c/find_obj_ferns.cpp
samples/c/one_way_sample.cpp
samples/c/polar_transforms.c
samples/c/pyramid_segmentation.c
samples/cpp/bagofwords_classification.cpp
samples/cpp/kinect_maps.cpp
samples/cpp/letter_recog.cpp
samples/cpp/multicascadeclassifier.cpp
samples/cpp/points_classifier.cpp

index 39b6b9f..31a0231 100644 (file)
@@ -1929,8 +1929,8 @@ void cv::drawChessboardCorners( InputOutputArray _image, Size patternSize,
 bool cv::findCirclesGrid( const InputArray& _image, Size patternSize,
                           OutputArray _centers, int flags, const Ptr<FeatureDetector> &blobDetector )
 {
-    bool isAsymmetricGrid = (bool)(flags & CALIB_CB_ASYMMETRIC_GRID);
-    bool isSymmetricGrid = (bool)(flags & CALIB_CB_SYMMETRIC_GRID);
+       bool isAsymmetricGrid = (flags & CALIB_CB_ASYMMETRIC_GRID) ? true : false;
+       bool isSymmetricGrid  = (flags & CALIB_CB_SYMMETRIC_GRID ) ? true : false;
     CV_Assert(isAsymmetricGrid ^ isSymmetricGrid);
 
     Mat image = _image.getMat();
index cf7d032..c16cce5 100644 (file)
@@ -2001,6 +2001,7 @@ float CvSVM::predict( const float* row_sample, int row_len, bool returnDFVal ) c
 
     int var_count = get_var_count();
     assert( row_len == var_count );
+       (void)row_len;
 
     int class_count = class_labels ? class_labels->cols :
                   params.svm_type == ONE_CLASS ? 1 : 0;
index e3ed84a..f91e5f3 100644 (file)
@@ -180,7 +180,7 @@ bool ASDFrameSequencer::isOpen()
        return false;\r
 };\r
 \r
-void ASDFrameSequencer::getFrameCaption(char *caption) {\r
+void ASDFrameSequencer::getFrameCaption(char* /*caption*/) {\r
        return;\r
 };\r
 \r
index ae20520..207619f 100644 (file)
@@ -120,7 +120,7 @@ int main(int argc, char** argv)
     for( i = 0; i < (int)pairs.size(); i += 2 )
     {
         line( correspond, objKeypoints[pairs[i]].pt,
-             imgKeypoints[pairs[i+1]].pt + Point2f(0,object.rows),
+             imgKeypoints[pairs[i+1]].pt + Point2f(0,(float)object.rows),
              Scalar(0,255,0) );
     }
     
index e9320a9..817a1d5 100644 (file)
@@ -108,7 +108,7 @@ IplImage* DrawCorrespondences(IplImage* img1, const vector<KeyPoint>& features1,
 
     for (size_t i = 0; i < features2.size(); i++)
     {
-        CvPoint pt = cvPoint(features2[i].pt.x + img1->width, features2[i].pt.y);
+        CvPoint pt = cvPoint((int)features2[i].pt.x + img1->width, (int)features2[i].pt.y);
         cvCircle(img_corr, pt, 3, CV_RGB(255, 0, 0));
         cvLine(img_corr, features1[desc_idx[i]].pt, pt, CV_RGB(0, 255, 0));
     }
index 2dfab7a..4271e3a 100644 (file)
@@ -1,6 +1,8 @@
 #include "opencv2/imgproc/imgproc.hpp"
 #include "opencv2/highgui/highgui.hpp"
 
+#include "opencv2/imgproc/imgproc_c.h"
+
 #include <ctype.h>
 #include <stdio.h>
 
index f955fbf..5bd8464 100644 (file)
@@ -1,5 +1,6 @@
 #include "opencv2/imgproc/imgproc.hpp"
 #include "opencv2/highgui/highgui.hpp"
+#include "opencv2/imgproc/imgproc_c.h"
 #include <stdio.h>
 
 void help()
index 22ac48e..f48ed7c 100644 (file)
@@ -855,7 +855,7 @@ void VocData::calcPrecRecall_impl(const vector<char>& ground_truth, const vector
     {
         recall_norm = recall_normalization;
     } else {
-        recall_norm = (int)std::count_if(ground_truth.begin(),ground_truth.end(),std::bind2nd(std::equal_to<bool>(),true));
+        recall_norm = (int)std::count_if(ground_truth.begin(),ground_truth.end(),std::bind2nd(std::equal_to<char>(),(char)1));
     }
 
     ap = 0;
@@ -985,7 +985,7 @@ void VocData::calcClassifierConfMatRow(const string& obj_class, const vector<Obd
         /* in order to calculate the total number of relevant images for normalization of recall
             it's necessary to extract the ground truth for the images under consideration */
         getClassifierGroundTruth(obj_class, images, ground_truth);
-        total_relevant = std::count_if(ground_truth.begin(),ground_truth.end(),std::bind2nd(std::equal_to<bool>(),true));
+        total_relevant = std::count_if(ground_truth.begin(),ground_truth.end(),std::bind2nd(std::equal_to<char>(),(char)1));
     }
 
     /* iterate through images */
@@ -2292,8 +2292,8 @@ void removeBowImageDescriptorsByCount( vector<ObdImage>& images, vector<Mat> bow
                                        const SVMTrainParamsExt& svmParamsExt, int descsToDelete )
 {
     RNG& rng = theRNG();
-    int pos_ex = std::count( objectPresent.begin(), objectPresent.end(), true );
-    int neg_ex = std::count( objectPresent.begin(), objectPresent.end(), false );
+    int pos_ex = std::count( objectPresent.begin(), objectPresent.end(), (char)1 );
+    int neg_ex = std::count( objectPresent.begin(), objectPresent.end(), (char)0 );
 
     while( descsToDelete != 0 )
     {
index 432b29a..280c6fd 100644 (file)
@@ -79,8 +79,8 @@ void colorizeDisparity( const Mat& gray, Mat& rgb, double maxDisp=-1.f, float S=
 float getMaxDisparity( VideoCapture& capture )
 {
     const int minDistance = 400; // mm
-    float b = capture.get( CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE ); // mm
-    float F = capture.get( CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH ); // pixels
+    float b = (float)capture.get( CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE ); // mm
+    float F = (float)capture.get( CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH ); // pixels
     return b * F / minDistance;
 }
 
index 61a75d7..9dd072b 100644 (file)
@@ -495,8 +495,8 @@ int build_knearest_classifier( char* data_filename, int K )
 
     int ok = read_num_class_data( data_filename, 16, &data, &responses );
     int nsamples_all = 0, ntrain_samples = 0;
-    int i, j;
-    double train_hr = 0, test_hr = 0;
+    //int i, j;
+    //double /*train_hr = 0,*/ test_hr = 0;
     CvANN_MLP mlp;
 
     if( !ok )
@@ -572,8 +572,8 @@ int build_nbayes_classifier( char* data_filename )
 
     int ok = read_num_class_data( data_filename, 16, &data, &responses );
     int nsamples_all = 0, ntrain_samples = 0;
-    int i, j;
-    double train_hr = 0, test_hr = 0;
+    //int i, j;
+    //double /*train_hr = 0, */test_hr = 0;
     CvANN_MLP mlp;
 
     if( !ok )
@@ -612,7 +612,7 @@ int build_nbayes_classifier( char* data_filename )
     CvMat *result = cvCreateMat(1, nsamples_all - ntrain_samples, CV_32FC1);
     (int)nbayes.predict(&sample, result);
     int true_resp = 0;
-    int accuracy = 0;
+    //int accuracy = 0;
     for (int i = 0; i < nsamples_all - ntrain_samples; i++)
     {
         if (result->data.fl[i] == true_results[i])
index b25ee40..29fe7ac 100644 (file)
@@ -155,7 +155,7 @@ void DetectAndDraw( Mat& img, CascadeClassifier& cascade)
         int radius;
         center.x = cvRound(r->x + r->width*0.5);
         center.y = cvRound(r->y + r->height*0.5);
-        radius = cvRound(r->width + r->height)*0.25;
+        radius = (int)(cvRound(r->width + r->height)*0.25);
         circle( img, center, radius, color, 3, 8, 0 );
     }
 
index 0479e29..b6a9027 100644 (file)
@@ -493,7 +493,7 @@ int main()
 
     for(;;)
     {
-        uchar key = waitKey();
+        uchar key = (uchar)waitKey();
 
         if( key == 27 ) break;