source: issm/trunk/src/m/contrib/larour/morphological/nunataks.m@ 20500

Last change on this file since 20500 was 20500, checked in by Mathieu Morlighem, 9 years ago

merged trunk-jpl and trunk for revision 20497

File size: 537 bytes
Line 
1function [mask]=nunataks(mask)
2%NUNATAKS - bias mask towards increased 0 coverage
3%
4% mask is an image of arbitrary size, format binary, with values 1 for foreground, and 0 for background
5%
6% Usage: mask=nunataks(mask)
7% [mask]=aggregation(mask);
8%
9% See also CLOSING, OPENING, DILATION, EROSION, AGGREGATION
10
11rocks=~mask;
12
13%matrices for convolution:
14matrix=[0 1 0; 1 0 1; 0 1 0];
15
16%do not exist, i.e. locations that stand pretty much alone.
17mask=filter2(matrix1,mask,'same');
18pos=find(~crocks & rocks);
19
20mask(pos)=0;
Note: See TracBrowser for help on using the repository browser.