How to plot pcolor over an image / map ?

3 visualizaciones (últimos 30 días)
Nazim YAKHOU
Nazim YAKHOU el 1 de Sept. de 2019
Comentada: Nazim YAKHOU el 2 de Sept. de 2019
Hello,
I am currently working on a matlab app that computes and plots the heatflux generated by a fire.
The heatflux distribution by distance is displayed with a pseudocolor plot (illustration below). I would like to superimpose this plot over a map (image) to illustrate the spacial distribution.
I came across many threads on this forum but I couldn't find a workaround on how to place pcolor image precisely on the map image.
Here is the heatmap generated by pcolor
Below is an illustration of the expected result.
This is the code I ve been testing :
f = figure;
load('ddd.mat') ;
I = imread('map.png');
imshow(I)
hold on
b = pcolor(X,Y,heat_flux_batch2D) ;
% X & Y => 2D MESH / coordinates
% heat_flux_batch2D : contains heat flux values
b.FaceColor = 'interp';
b.FaceAlpha = 0.35 ;
colormap(f,jet(64));
shading interp;
caxis([-1 max(heat_flux_batch2D(:))]);
hold off
The problem is :
  • I don't know how to position the pcolor in a specific region of the map / image below it
  • I also need to resize the pcolor because it has a different scale than the map. ( it's a screenshot from google map so I could retrieve the actual scale that is 1px <=> 4..6 m ).
So basically, I need to resize the pcolor image and place it on specific location over the map (depending on where the fire was triggered)
Thank you in advance for your help
  2 comentarios
Mark Hayworth
Mark Hayworth el 2 de Sept. de 2019
How did you get the units? Was the pseudocolored image generated from the RGB image so that both are registered (aligned)? Do both the mat file and the image have the same units? Like pixels or something else?
Nazim YAKHOU
Nazim YAKHOU el 2 de Sept. de 2019
Hello and thank you for your reply
The X & Y coordinates of the pcolor are in meters. The pcolor is stored as an image (jpg). But I can easily extrapolate distances because I already have the pixels / meters ratio (I just divide the size of the pcolor by the number of pixels). I also have the px/m ratio of the map image (by measuring the distance from google maps).

Iniciar sesión para comentar.

Respuestas (0)

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by