[mmgdist] [Up] [mmclohole] Image Transforms

mmopentransf
Open transform.

Synopsis

function y = mmopentransf ( f , type , n , Bc , Buser )

Input

f Image Binary image
type String

Default: 'OCTAGON'

Disk family: 'OCTAGON', 'CHESSBOARD', 'CITY-BLOCK', 'LINEAR-V', 'LINEAR-H', 'LINEAR-45R', 'LINEAR-45L', 'USER'.

n Double

Default: 65535

Maximum disk radii.

Bc Structuring Element

Default: 3x3 elementary cross

Connectivity for the reconstructive opening. Used if '-REC' suffix is appended in the 'type' string.

Buser Structuring Element

Default: 3x3 elementary cross

User disk, used if 'type' is 'USER'.

Output

y Image Gray-scale (uint8 or uint16) image

Description

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.

Examples

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
The open transform stores all the openings by the disk with radii r
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

Equation

Sequence of convex structuring elements of increasing size
Algorithm implemented
Interpretation

Limitations

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.

See also

mmopen Morphological opening.
mmsedisk Create a disk or a semi-sphere structuring element.
mmpatspec Pattern spectrum (also known as granulometric size density).
[mmgdist] [Up] [mmclohole]