Quiver Plot over Binary map
2 次查看(过去 30 天)
显示 更早的评论
I have a binary image of the coastline and would like to plot quiver (representative of wind) on the top of the binary map. The issue I am having is:
(1) How to plot vectors on the water area by extracting the features between land and water?
(2) How to finally get a combined image comprising of vector and binary data?
My current code is here:
im = imread('Genova_Binary.tif');
[x,y] = meshgrid(-2:.2:2,-1:.15:1);
z = x .* exp(-x.^2 - y.^2); [px,py] = gradient(z,.2,.15);
quiver(x,y,px,py); axis image %plot the quiver to see the dimensions of the plot
hax = gca; %get the axis handle
image(hax.XLim,hax.YLim,im); %plot the image within the axis limits
hold on; %enable plotting overwrite
quiver(x,y,px,py) %plot the quiver on top of the image (same axis limits)
0 个评论
回答(1 个)
KALYAN ACHARJYA
2022-6-14
编辑:KALYAN ACHARJYA
2022-6-14
im = imread('Genova_Binary.tif');
[x,y] = meshgrid(-2:.2:2,-1:.15:1);
z = x .* exp(-x.^2 - y.^2); [px,py] = gradient(z,.2,.15);
quiver(x,y,px,py); axis image %plot the quiver to see the dimensions of the plot
hax = gca; %get the axis handle
image(hax.XLim,hax.YLim,im); %plot the image within the axis limits
hold on; %enable plotting overwrite
quiver(x,y,px,py) %plot the quiver on top of the image (same axis limits)
Please ensure "Genova_Binary.tif" must be in currunt working directory.
2 个评论
KALYAN ACHARJYA
2022-6-18
Can it be done segmentation in particular water area only (after quiver plot)? Is that OK?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Vector Fields 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!