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

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

merged trunk-jpl and trunk for revision 20497

File size: 537 bytes
RevLine 
[14580]1function [mask]=nunataks(mask)
[14597]2%NUNATAKS - bias mask towards increased 0 coverage
[14580]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
[14597]11rocks=~mask;
[14580]12
[14597]13%matrices for convolution:
14matrix=[0 1 0; 1 0 1; 0 1 0];
[14580]15
[14597]16%do not exist, i.e. locations that stand pretty much alone.
17mask=filter2(matrix1,mask,'same');
18pos=find(~crocks & rocks);
[14580]19
[14597]20mask(pos)=0;
Note: See TracBrowser for help on using the repository browser.