1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

fixed bug: opencv read tif file convert Palette color image as grayscale image

This commit is contained in:
Harvey
2021-10-27 13:52:54 +08:00
parent 9e6c290696
commit af154e3053
2 changed files with 16 additions and 1 deletions
+10
View File
@@ -219,6 +219,16 @@ TEST(Imgcodecs_Tiff, readWrite_32FC3_RAW)
EXPECT_EQ(0, remove(filenameOutput.c_str()));
}
TEST(Imgcodecs_Tiff, read_palette_color_image)
{
const string root = cvtest::TS::ptr()->get_data_path();
const string filenameInput = root + "readwrite/test_palette_color_image.tif";
const Mat img = cv::imread(filenameInput, IMREAD_UNCHANGED);
ASSERT_FALSE(img.empty());
ASSERT_EQ(CV_8UC3, img.type());
}
//==================================================================================================