How to make a heat map using python and openCV
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:
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.
sks
Updated on June 04, 2022Comments
-
sks almost 2 years
I am trying to implement this:
YouTube link- https://www.youtube.com/watch?v=Qk4V_x6B7jY&t=5s
I want to use python and openCV but I am a beginner in openCV and hence, I have no idea How to implement this.
I have some basic idea. I have been able to track motion and draw a rectangle around the moving object and i am saving the co-ordinates of the rectangle in an external csv file. But, i am stuck on plotting heat map part. How to make it so that, over time when people are moving more and more in an area, the color changes from blue(normal movement ) to red (high movement) ? Please help..