How to make a heat map using python and openCV

18,890

So the basic idea for plotting a heat map is to visually get some feedback for the probability of a given particular event, You may write your own method which may take probability in range 0-1 and output a color in range (255, 0, 0) - (0, 0, 255). Or Opencv has provision of color-maps. You may be interested in using the COLORMAP_JET:

enter image description here

And Now you have to normalize the probability in range 0-255 instead of 0-1 and the you may use cv2.applyColorMap(input_prob, cv2.COLORMAP_JET) to get the desired output.

Share:
18,890
sks
Author by

sks

Updated on June 04, 2022

Comments