How to convert a grayscale image to heatmap image with Python OpenCV

后端 未结 2 557
轮回少年
轮回少年 2020-12-18 08:43

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

2条回答
  •  天涯浪人
    2020-12-18 09:29

    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).

提交回复
热议问题