How can I overlay a google earth image with a quiver plot?

10 visualizzazioni (ultimi 30 giorni)
Hello, I would like to overlay a google image with a quiver plot but have no idea where to start. The purpose is to display current velocities around a reef.
It would be great if someone could point me in the right direction to start with.

Risposta accettata

Jonathan LeSage
Jonathan LeSage il 18 Ott 2013
Modificato: Jonathan LeSage il 18 Ott 2013
If you have a map image of your area of interest, you could plot and scale the map coordinates using the imagesc function after reading the image in with the imread function. Furthermore, if you have known points of reference on the map and know the scale, you can simply plot your quiver plot directly over the map image!
Here is an extremely basic outline of how your code could look. The coordinates are up to you to fill in, of course:
% Import map image
mapImage = imread('map.jpg');
imagesc(xMin:xMax,yMin:yMax,mapImage);
hold on;
% Overlay the quiver plot
quiver(x,y,dx,dy);
The primary trick here is to ensure your scales of the map and your quiver plot are aligned. I am also assuming that you will be plotting over a relatively small area such that map projection/transformations are not an issue. I would recommend brushing up on projections, just in case:
You could also check out the MATLAB mapping toolbox that helps make georeferencing more straightforward.
Hope this helps to get you started!
  2 Commenti
Anna Marshall
Anna Marshall il 3 Mag 2020
Hi Jonathan- I have a similar question with overlaying a quiver plot onto an image that I am hoping you might be able to help me with. I have an image with orientations that I would like to overlay quiver arrows on to (and then change the colors based on angles). Do you have any suggestions for how to overlay the quiver plot? Thanks!
rgbImage = imread('DJI_0022.jpg'); %inputs image
hFig = figure;
subplot(2, 2, 1);
imshow(rgbImage)
axis('on', 'image');
impixelinfo;
title('Original RGB Image', 'FontSize', 20);
grayImage = rgb2gray(rgbImage); %convers to grayscale
subplot(2, 2, 2);
imshow(grayImage)
axis('on', 'image');
impixelinfo;
title('Gray Scale Image', 'FontSize', 20);
edgeImage = edge(grayImage, 'Canny', 0.6);
subplot(2, 2, 3);
imshow(edgeImage)
axis('on', 'image');
title('Canny Edge Image', 'FontSize', 20);
hFig.WindowState = 'maximized';
drawnow;
figure
% Get coordinates.
props = regionprops(edgeImage, 'PixelList');
for k = 1 : length(props)
thisList = props(k).PixelList;
fprintf('\nFor blob #%d of %d:\n ', k, length(props))
for k2 = 1 : size(thisList, 1)
thisx = thisList(k2, 1);
thisy = thisList(k2, 2);
fprintf('(%d, %d), ', thisx, thisy);
end
end
props = regionprops(edgeImage, 'Orientation');
allAngles = [props.Orientation];
histogram(allAngles);
grid on;
xlabel('Angle', 'FontSize', 20);
ylabel('Count', 'FontSize', 20);
H=histogram(allAngles);
Image Analyst
Image Analyst il 3 Mag 2020
I think I did that in this link. Below the colors overlaid onto the gray scale image correspond to the angle of the edge blobs.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Vector Fields in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by