diff --git a/modules/imgproc/src/sumpixels.cpp b/modules/imgproc/src/sumpixels.cpp index 4aae88c6e..6485ef18b 100644 --- a/modules/imgproc/src/sumpixels.cpp +++ b/modules/imgproc/src/sumpixels.cpp @@ -214,7 +214,7 @@ void integral_##suffix( T* src, size_t srcstep, ST* sum, size_t sumstep, QT* sqs DEF_INTEGRAL_FUNC(8u32s, uchar, int, double) DEF_INTEGRAL_FUNC(8u32f, uchar, float, double) DEF_INTEGRAL_FUNC(8u64f, uchar, double, double) -DEF_INTEGRAL_FUNC(32f, float, float, float) +DEF_INTEGRAL_FUNC(32f, float, float, double) DEF_INTEGRAL_FUNC(32f64f, float, double, double) DEF_INTEGRAL_FUNC(64f, double, double, double) diff --git a/modules/imgproc/test/test_filter.cpp b/modules/imgproc/test/test_filter.cpp index db053da12..67787c18c 100644 --- a/modules/imgproc/test/test_filter.cpp +++ b/modules/imgproc/test/test_filter.cpp @@ -1576,7 +1576,7 @@ CV_IntegralTest::CV_IntegralTest() test_array[REF_OUTPUT].push_back(NULL); test_array[REF_OUTPUT].push_back(NULL); test_array[REF_OUTPUT].push_back(NULL); - element_wise_relative_error = false; + element_wise_relative_error = true; } @@ -1603,7 +1603,8 @@ void CV_IntegralTest::get_test_array_types_and_sizes( int test_case_idx, depth = depth == 0 ? CV_8U : CV_32F; cn += cn == 2; - sum_depth = depth == CV_8U && (cvtest::randInt(rng) & 1) == 1 ? CV_32S : CV_64F; + int b = (cvtest::randInt(rng) & 1) != 0; + sum_depth = depth == CV_8U && b ? CV_32S : b ? CV_32F : CV_64F; types[INPUT][0] = CV_MAKETYPE(depth,cn); types[OUTPUT][0] = types[REF_OUTPUT][0] = @@ -1626,10 +1627,10 @@ void CV_IntegralTest::get_test_array_types_and_sizes( int test_case_idx, } -double CV_IntegralTest::get_success_error_level( int /*test_case_idx*/, int i, int j ) +double CV_IntegralTest::get_success_error_level( int, int i, int j ) { int depth = test_mat[i][j].depth(); - return depth == CV_32S ? 0 : FLT_EPSILON; + return depth == CV_32S ? 0 : depth == CV_64F ? FLT_EPSILON : 5e-3; } diff --git a/modules/objdetect/src/cascadedetect.cpp b/modules/objdetect/src/cascadedetect.cpp index 01987dc3b..c4037fc63 100644 --- a/modules/objdetect/src/cascadedetect.cpp +++ b/modules/objdetect/src/cascadedetect.cpp @@ -622,7 +622,7 @@ bool HaarEvaluator::setImage( const Mat &image, Size _origWinSize ) tilted0.create( rn, cn, CV_32S); } sum = Mat(rn, cn, CV_32S, sum0.data); - sqsum = Mat(rn, cn, CV_32S, sqsum0.data); + sqsum = Mat(rn, cn, CV_64F, sqsum0.data); if( hasTiltedFeatures ) {