diff --git a/modules/imgproc/test/test_thresh.cpp b/modules/imgproc/test/test_thresh.cpp index 529bff70da..b7db66e989 100644 --- a/modules/imgproc/test/test_thresh.cpp +++ b/modules/imgproc/test/test_thresh.cpp @@ -170,7 +170,7 @@ static void test_threshold( const Mat& _src, Mat& _dst, const float* src = _src.ptr(i); float* dst = _dst.ptr(i); for( j = 0; j < width_n; j++ ) - dst[j] = src[j] > thresh ? maxval : 0.f; + dst[j] = (float)(src[j] > thresh ? maxval : 0.f); } else { @@ -203,7 +203,7 @@ static void test_threshold( const Mat& _src, Mat& _dst, const float* src = _src.ptr(i); float* dst = _dst.ptr(i); for( j = 0; j < width_n; j++ ) - dst[j] = src[j] > thresh ? 0.f : maxval; + dst[j] = (float)(src[j] > thresh ? 0.f : maxval); } else { @@ -244,7 +244,7 @@ static void test_threshold( const Mat& _src, Mat& _dst, for( j = 0; j < width_n; j++ ) { float s = src[j]; - dst[j] = s > thresh ? thresh : s; + dst[j] = (float)(s > thresh ? thresh : s); } } else