[hofig3s30] [Up] [hofig3s32] Chapter 3 - Morphological Processing of Binary Images

hofig3s31
Family of disks

Description

This figure illustrates the Euclidean, chessboard and city-block disks.

Demo Script

.

from morph import *
from Numeric import ones
f=mmbinary(ones((129,129)))
f[64,64]=0
d8=mmdist(f,mmsebox())
d4=mmdist(f,mmsecross())
dE=mmdist(f,mmsebox(),'EUCLIDEAN')
d8m=mmintersec(d8,mmgray(mmthreshad(d8,0,64)))
Warning: Converting input image from int32 to uint16.
Warning: Converting input image from int32 to uint16.
Warning: Converting input image from uint8 to uint16.
d4m=mmintersec(d4,mmgray(mmthreshad(d4,0,64)))
Warning: Converting input image from int32 to uint16.
Warning: Converting input image from int32 to uint16.
Warning: Converting input image from uint8 to uint16.
dEm=mmintersec(dE,mmgray(mmthreshad(dE,0,64)))
Warning: Converting input image from int32 to uint16.
Warning: Converting input image from int32 to uint16.
Warning: Converting input image from uint8 to uint16.
mmshow(dEm % 6)
Warning: Converting input image from int32 to uint16.
mmshow(d8m % 6)
Warning: Converting input image from int32 to uint16.
mmshow(d4m % 6)
Warning: Converting input image from int32 to uint16.
dEm % 6 d8m % 6 d4m % 6

[hofig3s30] [Up] [hofig3s32] http://www.python.org