[mmgdist] [Up] [mmclohole] Image Transforms

mmopentransf
Open transform.

Synopsis

y = mmopentransf ( f , type = 'OCTAGON', n = 65535, Bc = NullStrel, Buser = NullStrel )

Input

f Image Binary image

type String

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

Default: 'OCTAGON' ('OCTAGON')

n Double

Maximum disk radii.

Default: 65535 (65535)

Bc Structuring Element

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

Default: NullStrel (3x3 elementary cross)

Buser Structuring Element

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

Default: NullStrel (3x3 elementary cross)

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]])
print mmopentransf( f, 'city-block')
processing r= 0
processing r= 1
processing r= 2
[[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]]
print mmopentransf( f, 'linear-h')
processing r= 0
processing r= 1
processing r= 2
processing r= 3
[[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]]
print mmopentransf( f, 'linear-45r')
processing r= 0
processing r= 1
processing r= 2
processing r= 3
processing r= 4
[[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]]
print mmopentransf( f, 'user',10,mmsecross(),mmbinary([0,1,1]))
processing r= 0
processing r= 1
processing r= 2
processing r= 3
processing r= 4
[[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]]
print mmopentransf( f, 'city-block-rec')
processing r= 0
processing r= 1
processing r= 2
[[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)
print mmis(g1,'==',g2)
1.0
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]