mirror of
https://github.com/opencv/opencv.git
synced 2024-11-25 11:40:44 +08:00
another fix for #2332 test
This commit is contained in:
parent
78a0b9787c
commit
5b2271c6fb
@ -254,17 +254,15 @@ public:
|
||||
};
|
||||
|
||||
TEST(Highgui_Image, encode_png) { CV_GrfmtPNGEncodeTest test; test.safe_run(); }
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_JPEG
|
||||
TEST(Highgui_ImreadVSCvtColor, regression)
|
||||
{
|
||||
cvtest::TS& ts = *cvtest::TS::ptr();
|
||||
|
||||
const int MAX_MEAN_DIFF = 3;
|
||||
const int MAX_MEAN_DIFF = 1;
|
||||
const int MAX_ABS_DIFF = 10;
|
||||
|
||||
string imgName = string(ts.get_data_path()) + "/../cv/shared/lena.jpg";
|
||||
string imgName = string(ts.get_data_path()) + "/../cv/shared/lena.png";
|
||||
Mat original_image = imread(imgName);
|
||||
Mat gray_by_codec = imread(imgName, 0);
|
||||
Mat gray_by_cvt;
|
||||
@ -277,6 +275,7 @@ TEST(Highgui_ImreadVSCvtColor, regression)
|
||||
double actual_avg_diff = (double)mean(diff)[0];
|
||||
double actual_maxval, actual_minval;
|
||||
minMaxLoc(diff, &actual_minval, &actual_maxval);
|
||||
//printf("actual avg = %g, actual maxdiff = %g, npixels = %d\n", actual_avg_diff, actual_maxval, (int)diff.total());
|
||||
|
||||
EXPECT_LT(actual_avg_diff, MAX_MEAN_DIFF);
|
||||
EXPECT_LT(actual_maxval, MAX_ABS_DIFF);
|
||||
|
Loading…
Reference in New Issue
Block a user