source: issm/trunk-jpl/src/m/morphological/dilation.m@ 14580

Last change on this file since 14580 was 14525, checked in by Eric.Larour, 12 years ago

NEW: aggregation tool

File size: 384 bytes
Line 
1function mask=dilation(mask,neighboorhood)
2%deletion algorithm using 4 pixel neighboors.
3
4%convolve:
5
6matrix=ones(3,3);
7
8%4 neighboorhood:
9%corners
10if neighboorhood==4,
11 matrix(1,1)=0;
12 matrix(1,3)=0;
13 matrix(3,1)=0;
14 matrix(3,3)=0;
15end
16%center
17matrix(2,2)=0;
18
19%convolve mask:
20convol=filter2(matrix,mask,'same');
21
22pos=find(mask==0);
23pos2=find(convol(pos)~=0);
24
25mask(pos(pos2))=1;
Note: See TracBrowser for help on using the repository browser.