Reputation: 1367
I want to generate heat map on a certain image. I have a m by 2 matrix 'templeCoords' (representing the pixel points of the image). I was using the following lines to keep the image on.
C=Imread('nwntemplemap.png');
%% Display the picture
figure, imshow(C)
hold on;
HeatMap(templeCoords);
It opens 2 different windows - one with the image I loaded and the other one is the heat map I guess.
Unfortunately was not able to manage it since working with heat map for the first time. Can anyone help please?
Added Question: Is it even doable to draw heat maps with the available data I mentioned?
The picture on top is the scatter plot of the points and the image -
Upvotes: 4
Views: 7854
Reputation: 1447
I would make the heatmap and overlay your image(is it a maze?) on top of that. and make your image kind of transparent. check this out on how to do it. http://blogs.mathworks.com/steve/2009/02/18/image-overlay-using-transparency/
To use the HeatMap function in matlab,you need to feed in the 2-D histogram(i.e. how many observations at a specific coordinate) for your templeCoords. try this http://blogs.mathworks.com/videos/2010/01/22/advanced-making-a-2d-or-3d-histogram-to-visualize-data-density/
this
http://www.mathworks.com/matlabcentral/fileexchange/29709-function-to-make-a-2d-histogram
or this
http://www.mathworks.com/matlabcentral/fileexchange/14205-2d-histogram
Upvotes: 3