1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

fix data overflow problem in GaussianBlur

This commit is contained in:
Xinguang Bian
2021-05-21 15:17:20 +08:00
parent 5f4e55bc68
commit 7499a15c92
2 changed files with 14 additions and 1 deletions
@@ -220,6 +220,15 @@ TEST(GaussianBlur_Bitexact, regression_15015)
ASSERT_EQ(0.0, cvtest::norm(dst, src, NORM_INF));
}
TEST(GaussianBlur_Bitexact, overflow_20121)
{
Mat src(100, 100, CV_16UC1, Scalar(65535));
Mat dst;
GaussianBlur(src, dst, cv::Size(9, 9), 0.0);
double min_val;
minMaxLoc(dst, &min_val);
ASSERT_EQ(cvRound(min_val), 65535);
}
static void checkGaussianBlur_8Uvs32F(const Mat& src8u, const Mat& src32f, int N, double sigma)
{