| [mmgdist] [Up] [mmclohole] | Image Transforms |
| User Feedback |
| f | Image Binary image |
| type | String
Default: Disk family: 'OCTAGON', 'CHESSBOARD', 'CITY-BLOCK', 'LINEAR-V', 'LINEAR-H', 'LINEAR-45R', 'LINEAR-45L', 'USER'. |
| n | Double
Default: Maximum disk radii. |
| Bc | Structuring Element
Default: Connectivity for the reconstructive opening. Used if '-REC' suffix is appended in the 'type' string. |
| Buser | Structuring Element
Default: User disk, used if 'type' is 'USER'. |
| y | Image Gray-scale (uint8 or uint16) image |
Compute the open transform of a binary image. The value of the pixels in the open transform gives the largest radii of the disk plus 1, where the open by it is not empty at that pixel. The disk sequence must satisfy the following: if r > s, rB is sB-open, i.e. rB open by sB is equal rB. Note that the Euclidean disk does not satisfy this property in the discrete grid. This function also computes the reconstructive open transform by adding the suffix '-REC' in the 'type' parameter.
f = mmbinary([...
0 0 0 0 0 0 0 0;...
0 0 1 1 1 1 0 0;...
0 0 1 1 1 1 1 0;...
0 1 0 1 1 1 0 0;...
1 1 0 0 0 0 0 0]);
Warning: converting image from double to int32
mmopentransf( f, 'city-block')
processing r= 0
processing r= 1
processing r= 2
ans =
0 0 0 0 0 0 0 0
0 0 1 2 2 2 0 0
0 0 2 2 2 2 2 0
0 1 0 2 2 2 0 0
1 1 0 0 0 0 0 0
mmopentransf( f, 'linear-h')
Warning: converting image from double to int32
processing r= 0
processing r= 1
processing r= 2
processing r= 3
ans =
0 0 0 0 0 0 0 0
0 0 2 2 2 2 0 0
0 0 3 3 3 3 3 0
0 1 0 2 2 2 0 0
2 2 0 0 0 0 0 0
mmopentransf( f, 'linear-45r')
Warning: converting image from double to int32
processing r= 0
processing r= 1
processing r= 2
processing r= 3
processing r= 4
ans =
0 0 0 0 0 0 0 0
0 0 1 4 1 2 0 0
0 0 4 1 2 1 1 0
0 4 0 2 1 1 0 0
4 1 0 0 0 0 0 0
mmopentransf( f, 'user',10,mmsecross,mmimg2se(mmbinary([0 1 1])))
Warning: converting image from double to int32
processing r= 0
processing r= 1
processing r= 2
processing r= 3
processing r= 4
ans =
0 0 0 0 0 0 0 0
0 0 4 4 4 4 0 0
0 0 5 5 5 5 5 0
0 1 0 3 3 3 0 0
2 2 0 0 0 0 0 0
mmopentransf( f, 'city-block-rec')
processing r= 0
processing r= 1
processing r= 2
ans =
0 0 0 0 0 0 0 0
0 0 2 2 2 2 0 0
0 0 2 2 2 2 2 0
0 1 0 2 2 2 0 0
1 1 0 0 0 0 0 0
f=mmreadgray('numbers.tif');
mmshow(f);
g=mmopentransf(f,'OCTAGON');
processing r= 0 processing r= 1 processing r= 2 processing r= 3 processing r= 4
mmshow(g);
![]() |
![]() |
|
| f | g |
b=mmsedisk(3,'2D','OCTAGON');
g1=mmopen(f,b);
mmshow(g1);
g2=mmcmp(g,'>',3);
Warning: converting image from scalar to uint16
mmis(g1,'==',g2)
ans =
1
![]() |
|
| g1 |



As this function may take a long time to execute, there is a printout notifying the status of the execution. The radii of the disk is informed for each open executed. Due to the behavior of the structuring element in the frame of the image, one may want to insert a zero border around the image.
| [mmgdist] [Up] [mmclohole] | |
| User Feedback | |
| Copyright (c) 1998-2008 by SDC Information Systems |