I've been struggling with this problem for a while now. I have some SAR images in the form of longitude and latitude matrices. These are images of the ocean, and my task is to identify some areas on the ocean, areas that lie between two different level lines (depth). My task is to create a mask matrix that can only show me the area between the two level lines. So I thought about closing the layer lines in a polygon as shown here in the image, because my initial intention was to use the inpolygon function. This function, however, takes an unreasonable time, so I have to find another way.
Then I noticed that the fill function allows me to highlight the target area...
The problem is that the fill function works only on the graphic part, I would like to know if there is a way to use the fill function in order to build a mask matrix useful to filter from the longitude and latitude matrices only the value in that zone.
Can someone help me? Thanks in advance!
The code is:
axis([-6 3 44 52])
xv=[xdata5 xdata70 xdata5(1)];
yv=[ydata5 ydata70 ydata5(1)];
legend('image pixel','iso-Depth polygon')
A = fill(xv,yv,'r')