@@ -2297,7 +2297,7 @@ static void validateResult(const Mat& reference, const Mat& actual, const Mat& s
2297
2297
ssize.width *= cn;
2298
2298
bool next = true ;
2299
2299
// RGB2Lab_f works throug LUT and brings additional error
2300
- static const float maxErr = 1 .f /200 .f ;
2300
+ static const float maxErr = 1 .f /192 .f ;
2301
2301
2302
2302
for (int y = 0 ; y < ssize.height && next; ++y)
2303
2303
{
@@ -2335,20 +2335,22 @@ TEST(Imgproc_ColorLab_Full, accuracy)
2335
2335
Size ssize = src.size ();
2336
2336
CV_Assert (ssize.width == ssize.height );
2337
2337
2338
- RNG& rng = cvtest::TS::ptr ()->get_rng ();
2339
- int blueInd = rng.uniform (0 ., 1 .) > 0.5 ? 0 : 2 ;
2340
- bool srgb = rng.uniform (0 ., 1 .) > 0.5 ;
2341
-
2342
- // Convert test image to LAB
2343
- cv::Mat lab;
2344
- int forward_code = blueInd ? srgb ? CV_BGR2Lab : CV_LBGR2Lab : srgb ? CV_RGB2Lab : CV_LRGB2Lab;
2345
- int inverse_code = blueInd ? srgb ? CV_Lab2BGR : CV_Lab2LBGR : srgb ? CV_Lab2RGB : CV_Lab2LRGB;
2346
- cv::cvtColor (src, lab, forward_code);
2347
- // Convert LAB image back to BGR(RGB)
2348
- cv::Mat recons;
2349
- cv::cvtColor (lab, recons, inverse_code);
2350
-
2351
- validateResult (src, recons, src, forward_code);
2338
+ for (int i = 0 ; i < 4 ; i++)
2339
+ {
2340
+ int blueInd = (i%2 ) > 0 ? 0 : 2 ;
2341
+ bool srgb = i > 1 ;
2342
+
2343
+ // Convert test image to LAB
2344
+ cv::Mat lab;
2345
+ int forward_code = blueInd ? srgb ? CV_BGR2Lab : CV_LBGR2Lab : srgb ? CV_RGB2Lab : CV_LRGB2Lab;
2346
+ int inverse_code = blueInd ? srgb ? CV_Lab2BGR : CV_Lab2LBGR : srgb ? CV_Lab2RGB : CV_Lab2LRGB;
2347
+ cv::cvtColor (src, lab, forward_code);
2348
+ // Convert LAB image back to BGR(RGB)
2349
+ cv::Mat recons;
2350
+ cv::cvtColor (lab, recons, inverse_code);
2351
+
2352
+ validateResult (src, recons, src, forward_code);
2353
+ }
2352
2354
}
2353
2355
2354
2356
static void test_Bayer2RGB_EdgeAware_8u (const Mat& src, Mat& dst, int code)
0 commit comments