[hofig3s20] [Up] [hofig3s22] Chapter 3 - Morphological Processing of Binary Images

hofig3s21
Logical opening

Description

This figure illustrates the logical opening by detecting objects with both horizontal and vertical linear features or with both diagonal features.

Demo Script

.

from morph import *
A=mmreadgray('text2.tif')
B11=mmsedil(mmsebox(),mmserot(mmsedisk(13,'1D'),90))
C=mmopenrec(A,B11,mmsebox());
B12=mmsedil(mmsebox(),mmsedisk(8,'1D'))
D=mmopenrec(A,B12,mmsebox())
E=mmintersec(C,D)
B21=mmsedil(mmsebox(),mmserot(mmsedisk(4,'1D'),45))
F=mmopenrec(A,B21,mmsebox())
B22=mmsedil(mmsebox(),mmserot(mmsedisk(4,'1D'),-45))
G=mmopenrec(A,B22,mmsebox())
H=mmintersec(F,G)
I=mmunion(E,H)
mmshow(A)
mmshow(E)
mmshow(H)
mmshow(I)
A E
H I

[hofig3s20] [Up] [hofig3s22] http://www.python.org