From: Vadim Pisarevsky Date: Fri, 26 Nov 2010 18:25:30 +0000 (+0000) Subject: fixed warnings and errors reported by VS2010 X-Git-Tag: accepted/2.0/20130307.220821~4082 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01c1003d51dd97e6192c6aeac873acbfba279b4b;p=profile%2Fivi%2Fopencv.git fixed warnings and errors reported by VS2010 --- diff --git a/modules/features2d/include/opencv2/features2d/features2d.hpp b/modules/features2d/include/opencv2/features2d/features2d.hpp index 3714490..ae95ae6 100644 --- a/modules/features2d/include/opencv2/features2d/features2d.hpp +++ b/modules/features2d/include/opencv2/features2d/features2d.hpp @@ -1803,7 +1803,7 @@ struct CV_EXPORTS L2 ResultType result = ResultType(); for( int i = 0; i < size; i++ ) { - ResultType diff = a[i] - b[i]; + ResultType diff = (ResultType)(a[i] - b[i]); result += diff*diff; } return (ResultType)sqrt((double)result); diff --git a/modules/legacy/src/compat.cpp b/modules/legacy/src/compat.cpp index 9dc1319..5e7a0d6 100644 --- a/modules/legacy/src/compat.cpp +++ b/modules/legacy/src/compat.cpp @@ -573,7 +573,7 @@ void cvCalibrateCamera_64d( int image_count, int* _point_counts, /* Find 3d position of object given intrinsic camera parameters, 3d model of the object and projection of the object into view plane */ void cvFindExtrinsicCameraParams( int point_count, - CvSize image_size, CvPoint2D32f* _image_points, + CvSize, CvPoint2D32f* _image_points, CvPoint3D32f* _object_points, float* focal_length, CvPoint2D32f principal_point, float* _distortion_coeffs, float* _rotation_vector, float* _translation_vector ) @@ -598,7 +598,7 @@ void cvFindExtrinsicCameraParams( int point_count, /* Variant of the previous function that takes double-precision parameters */ void cvFindExtrinsicCameraParams_64d( int point_count, - CvSize image_size, CvPoint2D64f* _image_points, + CvSize, CvPoint2D64f* _image_points, CvPoint3D64f* _object_points, double* focal_length, CvPoint2D64f principal_point, double* _distortion_coeffs, double* _rotation_vector, double* _translation_vector ) diff --git a/samples/c/delaunay.c b/samples/c/delaunay.c index 3177d0e..1749932 100644 --- a/samples/c/delaunay.c +++ b/samples/c/delaunay.c @@ -1,6 +1,8 @@ -#include +#include #include +#include + /* the script demostrates iterative construction of delaunay triangulation and voronoi tesselation */ diff --git a/samples/c/demhist.c b/samples/c/demhist.c index 5ef2d24..a06b1a9 100644 --- a/samples/c/demhist.c +++ b/samples/c/demhist.c @@ -1,6 +1,8 @@ -#include +#include #include +#include + char file_name[] = "baboon.jpg"; int _brightness = 100; diff --git a/samples/c/distrans.c b/samples/c/distrans.c index 0bc66fc..b96c6c5 100644 --- a/samples/c/distrans.c +++ b/samples/c/distrans.c @@ -1,6 +1,8 @@ -#include +#include #include +#include + char wndname[] = "Distance transform"; char tbarname[] = "Threshold"; int mask_size = CV_DIST_MASK_5; diff --git a/samples/c/edge.c b/samples/c/edge.c index 125147c..3bdafb4 100644 --- a/samples/c/edge.c +++ b/samples/c/edge.c @@ -1,4 +1,4 @@ -#include +#include #include char wndname[] = "Edge"; diff --git a/samples/c/ffilldemo.c b/samples/c/ffilldemo.c index d65064a..a3cecd4 100644 --- a/samples/c/ffilldemo.c +++ b/samples/c/ffilldemo.c @@ -1,4 +1,4 @@ -#include +#include #include IplImage* color_img0; diff --git a/samples/c/houghlines.c b/samples/c/houghlines.c index 9ab0c2c..6291f35 100644 --- a/samples/c/houghlines.c +++ b/samples/c/houghlines.c @@ -1,5 +1,5 @@ #include "opencv2/highgui/highgui.hpp" -#include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgproc/imgproc_c.h" int main(int argc, char** argv) { diff --git a/samples/c/morphology.c b/samples/c/morphology.c index 0c15d70..f420607 100644 --- a/samples/c/morphology.c +++ b/samples/c/morphology.c @@ -1,5 +1,7 @@ #include "opencv2/highgui/highgui.hpp" -#include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgproc/imgproc_c.h" + +#include IplImage* src = 0; IplImage* dst = 0; diff --git a/samples/c/peopledetect.cpp b/samples/c/peopledetect.cpp index d57306e..b2ea5fa 100644 --- a/samples/c/peopledetect.cpp +++ b/samples/c/peopledetect.cpp @@ -67,7 +67,6 @@ int main(int argc, char** argv) // run the detector with default parameters. to get a higher hit-rate // (and more false alarms, respectively), decrease the hitThreshold and // groupThreshold (set groupThreshold to 0 to turn off the grouping completely). - int can = img.channels(); hog.detectMultiScale(img, found, 0, Size(8,8), Size(32,32), 1.05, 2); t = (double)getTickCount() - t; printf("tdetection time = %gms\n", t*1000./cv::getTickFrequency()); diff --git a/samples/c/squares.c b/samples/c/squares.c index da5d7bd..61aa09b 100644 --- a/samples/c/squares.c +++ b/samples/c/squares.c @@ -3,7 +3,7 @@ // It loads several images subsequentally and tries to find squares in // each image // -#include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/imgproc/imgproc_c.h" #include "opencv2/highgui/highgui.hpp" #include #include diff --git a/samples/cpp/brief_match_test.cpp b/samples/cpp/brief_match_test.cpp index 25864f0..d33ac09 100644 --- a/samples/cpp/brief_match_test.cpp +++ b/samples/cpp/brief_match_test.cpp @@ -44,7 +44,7 @@ void matches2points(const vector& matches, const vector& kpts_ } -float match(const vector& kpts_train, const vector& kpts_query, DescriptorMatcher& matcher, +double match(const vector& kpts_train, const vector& kpts_query, DescriptorMatcher& matcher, const Mat& train, const Mat& query, vector& matches) { @@ -112,7 +112,7 @@ int main(int ac, char ** av) cout << "matching with BruteForceMatcher" << endl; BruteForceMatcher matcher_popcount; vector matches_popcount; - float pop_time = match(kpts_1, kpts_2, matcher_popcount, desc_1, desc_2, matches_popcount); + double pop_time = match(kpts_1, kpts_2, matcher_popcount, desc_1, desc_2, matches_popcount); cout << "done BruteForceMatcher matching. took " << pop_time << " seconds" << endl; vector mpts_1, mpts_2; diff --git a/samples/cpp/build3dmodel.cpp b/samples/cpp/build3dmodel.cpp index 103f974..67b0357 100644 --- a/samples/cpp/build3dmodel.cpp +++ b/samples/cpp/build3dmodel.cpp @@ -371,7 +371,7 @@ struct EqKeypoints static void build3dmodel( const Ptr& detector, const Ptr& descriptorExtractor, - const vector& modelBox, + const vector& /*modelBox*/, const vector& imageList, const vector& roiList, const vector& poseList, diff --git a/samples/cpp/contours2.cpp b/samples/cpp/contours2.cpp index fc6073f..ccf71c1 100644 --- a/samples/cpp/contours2.cpp +++ b/samples/cpp/contours2.cpp @@ -33,7 +33,7 @@ void on_trackbar(int, void*) imshow("contours", cnt_img); } -int main( int argc, char** argv) +int main( int argc, char**) { Mat img = Mat::zeros(w, w, CV_8UC1); if(argc > 1) diff --git a/samples/cpp/starter_video.cpp b/samples/cpp/starter_video.cpp index 1f8f669..039cad5 100644 --- a/samples/cpp/starter_video.cpp +++ b/samples/cpp/starter_video.cpp @@ -35,7 +35,7 @@ int process(VideoCapture& capture) { if (frame.empty()) continue; imshow(window_name, frame); - char key = waitKey(5); //delay N millis, usually long enough to display and capture input + char key = (char)waitKey(5); //delay N millis, usually long enough to display and capture input switch (key) { case 'q': case 'Q':