1
0
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:
Suleyman TURKMEN
2024-09-24 02:17:36 +03:00
parent 450e741f8d
commit 48a48fe11c
6 changed files with 155 additions and 229 deletions
-45
View File
@@ -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: