How to convert a grayscale image to heatmap image with Python OpenCV
问题 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" representation. As an example, pixels with 255 should be of most heat and pixels with 0 should be with least heat. Others in-between. I also need to return the heat maps as Numpy arrays so I can later merge them to a video. Is there a way to achieve this? 回答1: You need to convert the image to a proper grayscale representation. This can be done a few ways,