I have a (540, 960, 1) shaped image with values ranging from [0..255] which is black and white. I need to convert it to a \"heatmap\" representatio
(540, 960, 1)
[0..255]
You need to convert the image to a proper grayscale representation. This can be done a few ways, particularly with imread(filename, cv2.IMREAD_GRAYSCALE). This reduces the shape of the image to (54,960) (hint, no third dimension).
imread(filename, cv2.IMREAD_GRAYSCALE)
(54,960)