I have a 2d Array/matrix of values, and I want to make a heatmap of it using OpenCV and C++. I want high values in the 2d array to correlate to a dark color, while the lower values in the 2d array to correlate to a lighter color. Can this be done using OpenCV?
Asked
Active
Viewed 260 times
1
-
2Have a look at the color map functionality: https://docs.opencv.org/3.4.15/d3/d50/group__imgproc__colormap.html – Micka Oct 12 '21 at 05:45
-
@Micka In that link, they say the input must be an image. What I'm looking for is something where the input is a 2d array or matrix, which then generates an image/heatmap out of it. – Voyager Oct 13 '21 at 14:18
-
1what's the difference between a 2D array with values and an image? The colormap just needs a cv::Mat with values. Maybe you have to scale your values to 0..1 (float) or 0..255 (8 bit) before feeding to colormap function. – Micka Oct 13 '21 at 14:22