[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] SDC Morphology Toolbox V1.1 15Jan02

mmopentransf - Open transform.


Synopsis
y = mmopentransf( f, type, n )
Input
f: Binary image (logical uint8).
type: String. Disk family: 'OCTAGON', 'CHESSBOARD', 'CITY-BLOCK', 'LINEAR-V', LINEAR-H'. Default: 'OCTAGON'.
n: Maximum disk radius. Default: 65535.
Output
y: 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 radius of the disk plus 1, where the open by it is not empty at that pixel. The disk sequency must satisfy the following: if r > s, rB is sB-open, i.e. rB open by sB is equal rB.
Limitation
As this function can take quite a long time to execute, there is a printout notifying the status of the execution. The radius of the disk is informed for each open executed.
Examples
f = logical(uint8([...
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]));
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, 'chessboard')

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     1     2     2     2     1     0
     0     1     0     2     2     2     0     0
     1     1     0     0     0     0     0     0
mmopentransf( f, 'linear-h')

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-v')

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     1     2     2     2     1     0
     0     2     0     2     2     2     0     0
     1     2     0     0     0     0     0     0
f=imread('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);
image
(f)
image
(g)

The open transform stores all the openings by the disk with radius 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
image
(g1)
Equation

Sequence of convex structuring elements of increasing size

equation

Algorithm implemented

equation

Interpretation

equation

See Also
mmopen - Morphological opening.
mmpatspec - Pattern spectrum (also known as granulometric size density).
mmsedisk - Create a disk or a semi-sphere structuring element.
Source code
mmopentransf.m

[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] Valid XHTML 1.0!
Copyright (c) 1998-2002 by SDC Information Systems