1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Allow applyColorMap for 1d arrays

This commit is contained in:
Vincent Rabaud
2026-04-20 13:38:40 +02:00
parent 924a10069c
commit 69020c6517
2 changed files with 14 additions and 1 deletions
+13
View File
@@ -3296,4 +3296,17 @@ TEST(ImgProc_cvtColor_InvalidNumOfChannels, regression_25971)
}
}
TEST(ImgProc_applyColorMap, dimensions)
{
cv::Mat1b src({0, 128, 255});
cv::Mat3b gt = (cv::Mat3b(1, 3) << cv::Vec3b(128, 0, 0), cv::Vec3b(126, 255, 130), cv::Vec3b(0, 0, 128));
cv::Mat3b dst;
cv::applyColorMap(src, dst, cv::COLORMAP_JET);
ASSERT_EQ(cv::norm(dst, gt, NORM_L1), 0);
src = src.t();
gt = gt.t();
cv::applyColorMap(src, dst, cv::COLORMAP_JET);
ASSERT_EQ(cv::norm(dst, gt, NORM_L1), 0);
}
}} // namespace