diff --git a/modules/core/include/opencv2/core/core.hpp b/modules/core/include/opencv2/core/core.hpp index 9751a5abcc..ca1dd3e34a 100644 --- a/modules/core/include/opencv2/core/core.hpp +++ b/modules/core/include/opencv2/core/core.hpp @@ -4117,7 +4117,8 @@ public: int index; }; - + +#if 0 class CV_EXPORTS AlgorithmImpl; /*! @@ -4163,7 +4164,8 @@ protected: Ptr impl; }; - +#endif + } #endif // __cplusplus diff --git a/modules/core/include/opencv2/core/operations.hpp b/modules/core/include/opencv2/core/operations.hpp index 45a6c6e87c..f06bf6eb89 100644 --- a/modules/core/include/opencv2/core/operations.hpp +++ b/modules/core/include/opencv2/core/operations.hpp @@ -3558,7 +3558,7 @@ template static inline std::ostream& operator << (std::ostream& ou return out; } -template struct AlgorithmParamType {}; +/*template struct AlgorithmParamType {}; template<> struct AlgorithmParamType { enum { type = CV_PARAM_TYPE_INT }; }; template<> struct AlgorithmParamType { enum { type = CV_PARAM_TYPE_REAL }; }; template<> struct AlgorithmParamType { enum { type = CV_PARAM_TYPE_STRING }; }; @@ -3600,7 +3600,7 @@ template void Algorithm::addParam(int propId, _Tp& value, bool rea template void Algorithm::setParamRange(int propId, const _Tp& minVal, const _Tp& maxVal) { setParamRange_(propId, AlgorithmParamType<_Tp>::type, &minVal, &maxVal); -} +}*/ } diff --git a/modules/core/src/arithm.cpp b/modules/core/src/arithm.cpp index 01018969dd..d0fc0f44a4 100644 --- a/modules/core/src/arithm.cpp +++ b/modules/core/src/arithm.cpp @@ -2271,7 +2271,7 @@ void cv::inRange(const InputArray& _src, const InputArray& _lowerb, BinaryFunc sccvtfunc = getConvertFunc(scdepth, CV_32S); sccvtfunc(lb.data, 0, 0, 0, (uchar*)ilbuf, 0, Size(cn, 1), 0); sccvtfunc(ub.data, 0, 0, 0, (uchar*)iubuf, 0, Size(cn, 1), 0); - int minval = getMinVal(depth), maxval = getMaxVal(depth); + int minval = cvRound(getMinVal(depth)), maxval = cvRound(getMaxVal(depth)); for( int k = 0; k < cn; k++ ) { diff --git a/modules/core/src/mathfuncs.cpp b/modules/core/src/mathfuncs.cpp index f28bb0cf13..fd57f378c3 100644 --- a/modules/core/src/mathfuncs.cpp +++ b/modules/core/src/mathfuncs.cpp @@ -115,7 +115,7 @@ static void FastAtan2_32f(const float *Y, const float *X, float *angle, int len, a = (y >= 0 ? CV_PI*0.5 : CV_PI*1.5) - x*y*(y2 + 0.43157974*x2)/(y2*y2 + x2*(0.76443945*y2 + 0.05831938*x2) + (float)DBL_EPSILON); } - angle[i] = a*scale; + angle[i] = (float)(a*scale); } } diff --git a/modules/core/src/matmul.cpp b/modules/core/src/matmul.cpp index 20bb513347..9d0d957dc4 100644 --- a/modules/core/src/matmul.cpp +++ b/modules/core/src/matmul.cpp @@ -1665,7 +1665,7 @@ diagtransform_( const T* src, T* dst, const WT* m, int len, int cn, int ) { const WT* _m = m; for( int j = 0; j < cn; j++, _m += cn + 1 ) - dst[j] = src[j]*_m[j] + _m[cn]; + dst[j] = saturate_cast(src[j]*_m[j] + _m[cn]); } } } @@ -2600,7 +2600,7 @@ static double dotProd_8u(const uchar* src1, const uchar* src2, int len) __m128i z = _mm_setzero_si128(); while( i < len0 ) { - blockSize = std::min(len0 - j, blockSize0); + blockSize = std::min(len0 - i, blockSize0); __m128i s = _mm_setzero_si128(); for( j = 0; j <= blockSize - 16; j += 16 ) { diff --git a/modules/imgproc/src/sumpixels.cpp b/modules/imgproc/src/sumpixels.cpp index 0562f6a1e8..4aae88c6eb 100644 --- a/modules/imgproc/src/sumpixels.cpp +++ b/modules/imgproc/src/sumpixels.cpp @@ -46,16 +46,16 @@ namespace cv { template -void integral_( const T* src, size_t srcstep, ST* sum, size_t sumstep, - QT* sqsum, size_t sqsumstep, ST* tilted, size_t tiltedstep, +void integral_( const T* src, size_t _srcstep, ST* sum, size_t _sumstep, + QT* sqsum, size_t _sqsumstep, ST* tilted, size_t _tiltedstep, Size size, int cn ) { int x, y, k; - srcstep /= sizeof(T); - sumstep /= sizeof(ST); - tiltedstep /= sizeof(ST); - sqsumstep /= sizeof(QT); + int srcstep = (int)(_srcstep/sizeof(T)); + int sumstep = (int)(_sumstep/sizeof(ST)); + int tiltedstep = (int)(_tiltedstep/sizeof(ST)); + int sqsumstep = (int)(_sqsumstep/sizeof(QT)); size.width *= cn; diff --git a/modules/imgproc/test/test_histograms.cpp b/modules/imgproc/test/test_histograms.cpp index 07633be88d..da1643b94a 100644 --- a/modules/imgproc/test/test_histograms.cpp +++ b/modules/imgproc/test/test_histograms.cpp @@ -1509,7 +1509,7 @@ cvTsCalcBackProject( IplImage** images, IplImage* dst, CvHistogram* hist, int* c } -int CV_CalcBackProjectTest::validate_test_results( int test_case_idx ) +int CV_CalcBackProjectTest::validate_test_results( int /*test_case_idx*/ ) { int code = cvtest::TS::OK; diff --git a/modules/imgproc/test/test_imgwarp.cpp b/modules/imgproc/test/test_imgwarp.cpp index 09e96aa883..f9aa53ea96 100644 --- a/modules/imgproc/test/test_imgwarp.cpp +++ b/modules/imgproc/test/test_imgwarp.cpp @@ -629,12 +629,12 @@ int CV_WarpPerspectiveTest::prepare_test_case( int test_case_idx ) s[0] = Point2f(0,0); d[0] = Point2f(0,0); - s[1] = Point2f(src.cols-1,0); - d[1] = Point2f(dst.cols-1,0); - s[2] = Point2f(src.cols-1,src.rows-1); - d[2] = Point2f(dst.cols-1,dst.rows-1); - s[3] = Point2f(0,src.rows-1); - d[3] = Point2f(0,dst.rows-1); + s[1] = Point2f(src.cols-1.f,0); + d[1] = Point2f(dst.cols-1.f,0); + s[2] = Point2f(src.cols-1.f,src.rows-1.f); + d[2] = Point2f(dst.cols-1.f,dst.rows-1.f); + s[3] = Point2f(0,src.rows-1.f); + d[3] = Point2f(0,dst.rows-1.f); float buf[16]; Mat tmp( 1, 16, CV_32FC1, buf ); diff --git a/modules/python/hdr_parser.pyc b/modules/python/hdr_parser.pyc deleted file mode 100755 index b3e9a5d651..0000000000 Binary files a/modules/python/hdr_parser.pyc and /dev/null differ diff --git a/modules/video/include/opencv2/video/background_segm.hpp b/modules/video/include/opencv2/video/background_segm.hpp index fbc745d88a..08ee221af0 100644 --- a/modules/video/include/opencv2/video/background_segm.hpp +++ b/modules/video/include/opencv2/video/background_segm.hpp @@ -400,7 +400,7 @@ public: }; -class BackgroundSubtractorMOG2 : public BackgroundSubtractor +class CV_EXPORTS BackgroundSubtractorMOG2 : public BackgroundSubtractor { public: //! the default constructor diff --git a/samples/cpp/brief_match_test.cpp b/samples/cpp/brief_match_test.cpp index ee4ba0e681..553ed1a21e 100644 --- a/samples/cpp/brief_match_test.cpp +++ b/samples/cpp/brief_match_test.cpp @@ -118,7 +118,7 @@ int main(int ac, char ** av) vector mpts_1, mpts_2; matches2points(matches_popcount, kpts_1, kpts_2, mpts_1, mpts_2); //Extract a list of the (x,y) location of the matches vector outlier_mask; - Mat H = findHomography(Mat(mpts_2), Mat(mpts_1), outlier_mask, RANSAC, 1); + Mat H = findHomography(mpts_2, mpts_1, RANSAC, 1, outlier_mask); Mat outimg; drawMatches(im2, kpts_2, im1, kpts_1, matches_popcount, outimg, Scalar::all(-1), Scalar::all(-1), diff --git a/samples/cpp/kmeans.cpp b/samples/cpp/kmeans.cpp index 4a48155567..7e52ca4174 100644 --- a/samples/cpp/kmeans.cpp +++ b/samples/cpp/kmeans.cpp @@ -54,7 +54,7 @@ int main( int /*argc*/, char** /*argv*/ ) kmeans(points, clusterCount, labels, TermCriteria( CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 10, 1.0), - 3, KMEANS_PP_CENTERS, ¢ers); + 3, KMEANS_PP_CENTERS, centers); img = Scalar::all(0); diff --git a/samples/cpp/stereo_calib.cpp b/samples/cpp/stereo_calib.cpp index 0dc429f411..2c1c91ff90 100644 --- a/samples/cpp/stereo_calib.cpp +++ b/samples/cpp/stereo_calib.cpp @@ -230,7 +230,7 @@ StereoCalib(const vector& imagelist, Size boardSize, bool useCalibrated= stereoRectify(cameraMatrix[0], distCoeffs[0], cameraMatrix[1], distCoeffs[1], imageSize, R, T, R1, R2, P1, P2, Q, - 1, imageSize, &validRoi[0], &validRoi[1]); + CALIB_ZERO_DISPARITY, 1, imageSize, &validRoi[0], &validRoi[1]); fs.open("extrinsics.yml", CV_STORAGE_WRITE); if( fs.isOpened() ) diff --git a/samples/cpp/stereo_match.cpp b/samples/cpp/stereo_match.cpp index f3616f60e6..cb02ae8178 100644 --- a/samples/cpp/stereo_match.cpp +++ b/samples/cpp/stereo_match.cpp @@ -178,7 +178,7 @@ int main(int argc, char** argv) fs["R"] >> R; fs["T"] >> T; - stereoRectify( M1, D1, M2, D2, img_size, R, T, R1, R2, P1, P2, Q, -1, img_size, &roi1, &roi2 ); + stereoRectify( M1, D1, M2, D2, img_size, R, T, R1, R2, P1, P2, Q, CALIB_ZERO_DISPARITY, -1, img_size, &roi1, &roi2 ); Mat map11, map12, map21, map22; initUndistortRectifyMap(M1, D1, R1, P1, img_size, CV_16SC2, map11, map12); diff --git a/samples/cpp/video_homography.cpp b/samples/cpp/video_homography.cpp index a91ea1a8c4..9ff374b104 100644 --- a/samples/cpp/video_homography.cpp +++ b/samples/cpp/video_homography.cpp @@ -182,7 +182,7 @@ int main(int ac, char ** av) if (matches.size() > 5) { - Mat H = findHomography(Mat(train_pts), Mat(query_pts), match_mask, RANSAC, 4); + Mat H = findHomography(train_pts, query_pts, RANSAC, 4, match_mask); if (countNonZero(Mat(match_mask)) > 15) { H_prev = H; diff --git a/samples/gpu/morfology.cpp b/samples/gpu/morfology.cpp index 702125bf8d..2090592f42 100644 --- a/samples/gpu/morfology.cpp +++ b/samples/gpu/morfology.cpp @@ -41,7 +41,7 @@ void OpenClose(int, void*) cv::gpu::morphologyEx(src, dst, CV_MOP_OPEN, element); else cv::gpu::morphologyEx(src, dst, CV_MOP_CLOSE, element); - imshow("Open/Close",dst); + imshow("Open/Close",(Mat)dst); } // callback function for erode/dilate trackbar @@ -54,7 +54,7 @@ void ErodeDilate(int, void*) cv::gpu::erode(src, dst, element); else cv::gpu::dilate(src, dst, element); - imshow("Erode/Dilate",dst); + imshow("Erode/Dilate",(Mat)dst); } diff --git a/samples/gpu/performance/tests.cpp b/samples/gpu/performance/tests.cpp index 18b45f2563..a4a5384a3a 100644 --- a/samples/gpu/performance/tests.cpp +++ b/samples/gpu/performance/tests.cpp @@ -784,10 +784,10 @@ TEST(projectPoints) void InitSolvePnpRansac() -{ - Mat object; gen(object, 1, 4, CV_32FC3, Scalar::all(0), Scalar::all(100)); - Mat image; gen(image, 1, 4, CV_32FC2, Scalar::all(0), Scalar::all(100)); - Mat rvec, tvec; +{ + Mat object; gen(object, 1, 4, CV_32FC3, Scalar::all(0), Scalar::all(100)); + Mat image; gen(image, 1, 4, CV_32FC2, Scalar::all(0), Scalar::all(100)); + Mat rvec, tvec; gpu::solvePnPRansac(object, image, Mat::eye(3, 3, CV_32F), Mat(), rvec, tvec); } @@ -796,31 +796,31 @@ TEST(solvePnPRansac) { InitSolvePnpRansac(); - for (int num_points = 5000; num_points <= 300000; num_points = int(num_points * 3.76)) - { - SUBTEST << "num_points " << num_points; - - Mat object; gen(object, 1, num_points, CV_32FC3, Scalar::all(10), Scalar::all(100)); - Mat image; gen(image, 1, num_points, CV_32FC2, Scalar::all(10), Scalar::all(100)); - Mat camera_mat; gen(camera_mat, 3, 3, CV_32F, 0.5, 1); - camera_mat.at(0, 1) = 0.f; - camera_mat.at(1, 0) = 0.f; - camera_mat.at(2, 0) = 0.f; - camera_mat.at(2, 1) = 0.f; - - Mat rvec, tvec; - const int num_iters = 200; - const float max_dist = 2.0f; - vector inliers_cpu, inliers_gpu; - - CPU_ON; - solvePnPRansac(object, image, camera_mat, Mat(), rvec, tvec, false, num_iters, - max_dist, int(num_points * 0.05), &inliers_cpu); - CPU_OFF; - - GPU_ON; - gpu::solvePnPRansac(object, image, camera_mat, Mat(), rvec, tvec, false, num_iters, - max_dist, int(num_points * 0.05), &inliers_gpu); + for (int num_points = 5000; num_points <= 300000; num_points = int(num_points * 3.76)) + { + SUBTEST << "num_points " << num_points; + + Mat object; gen(object, 1, num_points, CV_32FC3, Scalar::all(10), Scalar::all(100)); + Mat image; gen(image, 1, num_points, CV_32FC2, Scalar::all(10), Scalar::all(100)); + Mat camera_mat; gen(camera_mat, 3, 3, CV_32F, 0.5, 1); + camera_mat.at(0, 1) = 0.f; + camera_mat.at(1, 0) = 0.f; + camera_mat.at(2, 0) = 0.f; + camera_mat.at(2, 1) = 0.f; + + Mat rvec, tvec; + const int num_iters = 200; + const float max_dist = 2.0f; + vector inliers_cpu, inliers_gpu; + + CPU_ON; + solvePnPRansac(object, image, camera_mat, Mat(), rvec, tvec, false, num_iters, + max_dist, int(num_points * 0.05), inliers_cpu); + CPU_OFF; + + GPU_ON; + gpu::solvePnPRansac(object, image, camera_mat, Mat(), rvec, tvec, false, num_iters, + max_dist, int(num_points * 0.05), &inliers_gpu); GPU_OFF; } } \ No newline at end of file