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

Use NaN-safe clip function.

This is to prevent more NaN to int conversions like in #21111.
This commit is contained in:
Vincent Rabaud
2021-12-16 11:27:37 +01:00
parent 2329cbc1a2
commit 3da17c42a4
2 changed files with 8 additions and 6 deletions
+2
View File
@@ -3203,6 +3203,8 @@ TEST(ImgProc_RGB2Lab, NaN_21111)
src(0, 1) = src(0, 28) = src(0, 82) = src(0, 109) = cv::Vec3f(0, kNaN, 0);
src(0, 2) = src(0, 29) = src(0, 83) = src(0, 110) = cv::Vec3f(kNaN, 0, 0);
EXPECT_NO_THROW(cvtColor(src, dst, COLOR_RGB2Lab));
EXPECT_NO_THROW(cvtColor(src, dst, COLOR_RGB2Luv));
EXPECT_NO_THROW(cvtColor(src, dst, COLOR_Luv2RGB));
#if 0 // no NaN propagation guarantee
for (int i = 0; i < 20; ++i)