I've got a Java program running OpenCV and I'm using the MatchTemplate
function. I have an output Mat with values ranging from 0.0 to 1.0. I want to be able to track its output in real time by making this Mat into a grayscale image that I can display as a "heatmap" of where my template matches the input image.
I've converted the image to grayscale using convertTo
as suggested in the answer to this question and I'm using a third-party library called ImShow to get my Mat objects to display onscreen. It's working for my source images but my output, the result of the matchTemplate
function, just shows solid black.
I think the floating point values from 0.0 to 1.0 are being rounded down to 0. Can I multiply every pixel in this Mat by 255 in order to shift it into proper greyscale? How would I do that?