Skip to content

Commit

Permalink
Update imgcodecs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sturkmen72 committed May 12, 2024
1 parent 75f3f0f commit f3199a0
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion modules/highgui/src/window_w32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2161,7 +2161,7 @@ static void showSaveDialog(CvWindow& window)
#ifdef HAVE_TIFF
"TIFF Files (*.tiff;*.tif)\0*.tiff;*.tif\0"
#endif
#ifdef HAVE_JASPER
#if defined(HAVE_JASPER) || defined(HAVE_OPENJPEG)
"JPEG-2000 files (*.jp2)\0*.jp2\0"
#endif
#ifdef HAVE_WEBP
Expand Down
4 changes: 2 additions & 2 deletions modules/imgcodecs/test/test_avif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Imgcodecs_Avif_Image_RoundTripSuite
// bit depth.
static void SetUpTestCase() {
const string root = cvtest::TS::ptr()->get_data_path();
const string filename = root + "../cv/shared/lena.png";
const string filename = root + "../cv/shared/baboon.bmp";
const cv::Mat img_original = cv::imread(filename);
cv::Mat img_resized;
cv::resize(img_original, img_resized, cv::Size(kWidth, kHeight), 0, 0);
Expand Down Expand Up @@ -244,7 +244,7 @@ class Imgcodecs_Avif_Animation_RoundTripSuite
// bit depth.
static void SetUpTestCase() {
const string root = cvtest::TS::ptr()->get_data_path();
const string filename = root + "../cv/shared/lena.png";
const string filename = root + "../cv/shared/baboon.bmp";
const cv::Mat img_original = cv::imread(filename);
cv::Mat img_resized;
cv::resize(img_original, img_resized, cv::Size(kWidth, kHeight), 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion modules/imgcodecs/test/test_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Mat generateTestImageBGR_()
Size sz(640, 480);
Mat result(sz, CV_8UC3, Scalar::all(0));

const string fname = cvtest::findDataFile("../cv/shared/baboon.png");
const string fname = cvtest::findDataFile("../cv/shared/baboon.bmp");
Mat image = imread(fname, IMREAD_COLOR);
CV_Assert(!image.empty());
CV_CheckEQ(image.size(), Size(512, 512), "");
Expand Down
6 changes: 6 additions & 0 deletions modules/imgcodecs/test/test_grfmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,17 @@ const string all_images[] =
"readwrite/uint16-mono2.dcm",
"readwrite/uint8-rgb.dcm",
#endif
#if defined(HAVE_PNG) || defined(HAVE_SPNG)
"readwrite/color_palette_alpha.png",
#endif
#ifdef HAVE_TIFF
"readwrite/multipage.tif",
#endif
"readwrite/ordinary.bmp",
"readwrite/rle8.bmp",
#ifdef HAVE_JPEG
"readwrite/test_1_c1.jpg",
#endif
#ifdef HAVE_IMGCODEC_HDR
"readwrite/rle.hdr"
#endif
Expand Down
6 changes: 3 additions & 3 deletions modules/imgcodecs/test/test_jpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ TEST(Imgcodecs_Jpeg, encode_empty)
TEST(Imgcodecs_Jpeg, encode_decode_progressive_jpeg)
{
cvtest::TS& ts = *cvtest::TS::ptr();
string input = string(ts.get_data_path()) + "../cv/shared/lena.png";
string input = string(ts.get_data_path()) + "../cv/shared/baboon.bmp";
cv::Mat img = cv::imread(input);
ASSERT_FALSE(img.empty());

Expand All @@ -131,7 +131,7 @@ TEST(Imgcodecs_Jpeg, encode_decode_progressive_jpeg)
TEST(Imgcodecs_Jpeg, encode_decode_optimize_jpeg)
{
cvtest::TS& ts = *cvtest::TS::ptr();
string input = string(ts.get_data_path()) + "../cv/shared/lena.png";
string input = string(ts.get_data_path()) + "../cv/shared/baboon.bmp";
cv::Mat img = cv::imread(input);
ASSERT_FALSE(img.empty());

Expand All @@ -156,7 +156,7 @@ TEST(Imgcodecs_Jpeg, encode_decode_optimize_jpeg)
TEST(Imgcodecs_Jpeg, encode_decode_rst_jpeg)
{
cvtest::TS& ts = *cvtest::TS::ptr();
string input = string(ts.get_data_path()) + "../cv/shared/lena.png";
string input = string(ts.get_data_path()) + "../cv/shared/baboon.bmp";
cv::Mat img = cv::imread(input);
ASSERT_FALSE(img.empty());

Expand Down
4 changes: 3 additions & 1 deletion modules/imgcodecs/test/test_read_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ TEST(Imgcodecs_Image, regression_9376)

TEST(Imgcodecs_Image, write_umat)
{
const string src_name = TS::ptr()->get_data_path() + "../python/images/baboon.bmp";
const string src_name = TS::ptr()->get_data_path() + "../cv/shared/baboon.bmp";
const string dst_name = cv::tempfile(".bmp");

Mat image1 = imread(src_name);
Expand All @@ -303,6 +303,7 @@ TEST(Imgcodecs_Image, write_umat)
EXPECT_EQ(0, remove(dst_name.c_str()));
}

#ifdef HAVE_TIFF
TEST(Imgcodecs_Image, multipage_collection_size)
{
const string root = cvtest::TS::ptr()->get_data_path();
Expand Down Expand Up @@ -479,6 +480,7 @@ TEST(ImgCodecs, multipage_collection_two_iterator_operatorpp)
EXPECT_TRUE(cv::norm(img1, img[i], NORM_INF) == 0);
}
}
#endif


TEST(Imgcodecs_Params, imwrite_regression_22752)
Expand Down
2 changes: 1 addition & 1 deletion modules/imgcodecs/test/test_tiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ TEST(Imgcodecs_Tiff_Modes, write_multipage)
TEST(Imgcodecs_Tiff, imdecode_no_exception_temporary_file_removed)
{
const string root = cvtest::TS::ptr()->get_data_path();
const string filename = root + "../cv/shared/lena.png";
const string filename = root + "../cv/shared/baboon.bmp";
cv::Mat img = cv::imread(filename);
ASSERT_FALSE(img.empty());
std::vector<uchar> buf;
Expand Down
6 changes: 3 additions & 3 deletions modules/imgcodecs/test/test_webp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace opencv_test { namespace {
TEST(Imgcodecs_WebP, encode_decode_lossless_webp)
{
const string root = cvtest::TS::ptr()->get_data_path();
string filename = root + "../cv/shared/lena.png";
string filename = root + "../cv/shared/baboon.bmp";
cv::Mat img = cv::imread(filename);
ASSERT_FALSE(img.empty());

Expand Down Expand Up @@ -59,7 +59,7 @@ TEST(Imgcodecs_WebP, encode_decode_lossless_webp)
TEST(Imgcodecs_WebP, encode_decode_lossy_webp)
{
const string root = cvtest::TS::ptr()->get_data_path();
std::string input = root + "../cv/shared/lena.png";
std::string input = root + "../cv/shared/baboon.bmp";
cv::Mat img = cv::imread(input);
ASSERT_FALSE(img.empty());

Expand All @@ -83,7 +83,7 @@ TEST(Imgcodecs_WebP, encode_decode_lossy_webp)
TEST(Imgcodecs_WebP, encode_decode_with_alpha_webp)
{
const string root = cvtest::TS::ptr()->get_data_path();
std::string input = root + "../cv/shared/lena.png";
std::string input = root + "../cv/shared/baboon.bmp";
cv::Mat img = cv::imread(input);
ASSERT_FALSE(img.empty());

Expand Down
2 changes: 1 addition & 1 deletion modules/video/test/test_optflowpyrlk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ TEST(Video_OpticalFlowPyrLK, accuracy) { CV_OptFlowPyrLKTest test; test.safe_run
TEST(Video_OpticalFlowPyrLK, submat)
{
// see bug #2075
std::string path = cvtest::TS::ptr()->get_data_path() + "../cv/shared/lena.png";
std::string path = cvtest::TS::ptr()->get_data_path() + "../cv/shared/baboon.bmp";

cv::Mat lenaImg = cv::imread(path);
ASSERT_FALSE(lenaImg.empty());
Expand Down

0 comments on commit f3199a0

Please sign in to comment.