Quiver Plot over Binary map

조회 수: 3 (최근 30일)
Yogang
Yogang 2022년 6월 14일
댓글: KALYAN ACHARJYA 2022년 6월 18일
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');
Error using imread>get_full_filename
File "Genova_Binary.tif" does not exist.

Error in imread (line 371)
fullname = get_full_filename(filename);
[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)

답변 (1개)

KALYAN ACHARJYA
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
Yogang
Yogang 2022년 6월 14일
I am already having the working code here for the above plot but my question is :
(1) How to plot vectors on the water area by extracting the features between land and water? So I just want the vectors over water area not over land.
KALYAN ACHARJYA
KALYAN ACHARJYA 2022년 6월 18일
Can it be done segmentation in particular water area only (after quiver plot)? Is that OK?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by