mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Enable PNG exif orientation test
This commit is contained in:
@@ -187,51 +187,6 @@ INSTANTIATE_TEST_CASE_P(
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef testing::TestWithParam<string> Imgcodecs_AVIF_Exif;
|
||||
|
||||
TEST_P(Imgcodecs_AVIF_Exif, exif_orientation) {
|
||||
const string root = cvtest::TS::ptr()->get_data_path();
|
||||
const string filename = root + GetParam();
|
||||
const int colorThresholdHigh = 250;
|
||||
const int colorThresholdLow = 5;
|
||||
|
||||
Mat m_img = imread(filename);
|
||||
ASSERT_FALSE(m_img.empty());
|
||||
Vec3b vec;
|
||||
|
||||
// Checking the first quadrant (with supposed red)
|
||||
vec = m_img.at<Vec3b>(2, 2); // some point inside the square
|
||||
EXPECT_LE(vec.val[0], colorThresholdLow);
|
||||
EXPECT_LE(vec.val[1], colorThresholdLow);
|
||||
EXPECT_GE(vec.val[2], colorThresholdHigh);
|
||||
|
||||
// Checking the second quadrant (with supposed green)
|
||||
vec = m_img.at<Vec3b>(2, 7); // some point inside the square
|
||||
EXPECT_LE(vec.val[0], colorThresholdLow);
|
||||
EXPECT_GE(vec.val[1], colorThresholdHigh);
|
||||
EXPECT_LE(vec.val[2], colorThresholdLow);
|
||||
|
||||
// Checking the third quadrant (with supposed blue)
|
||||
vec = m_img.at<Vec3b>(7, 2); // some point inside the square
|
||||
EXPECT_GE(vec.val[0], colorThresholdHigh);
|
||||
EXPECT_LE(vec.val[1], colorThresholdLow);
|
||||
EXPECT_LE(vec.val[2], colorThresholdLow);
|
||||
}
|
||||
|
||||
const string exif_files[] = {"readwrite/testExifOrientation_1.avif",
|
||||
"readwrite/testExifOrientation_2.avif",
|
||||
"readwrite/testExifOrientation_3.avif",
|
||||
"readwrite/testExifOrientation_4.avif",
|
||||
"readwrite/testExifOrientation_5.avif",
|
||||
"readwrite/testExifOrientation_6.avif",
|
||||
"readwrite/testExifOrientation_7.avif",
|
||||
"readwrite/testExifOrientation_8.avif"};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(ExifFiles, Imgcodecs_AVIF_Exif,
|
||||
testing::ValuesIn(exif_files));
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class Imgcodecs_Avif_Animation_RoundTripSuite
|
||||
: public Imgcodecs_Avif_RoundTripSuite {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user