| [Up] [hoeq1s1] | Chapter 1 - Binary Erosion and Dilation |
This figure illustrates the principle of fitting.
The binary image to be processed is read. The structuring element is created from box of radius 25.
from morph import *
from handson import *
F=mmreadgray('blob_1.tif')
print 'The pixel datatype of image F is ',mmdatatype(F)
The pixel datatype of image F is binary
mmshow(F)
B=mmsebox(25)
mmshow(mmseshow(B))
![]() |
![]() |
|
| F | mmseshow(B) |
An image of two points to translate the structuring element is created. The 3x3 elementary cross is placed on these points to mark them more clearly. Then this image with the two points is dilated by the structuring element.
The original image and the edges of the translated structuring elements are combined using their symmetrical difference.
G=mmsymdif(F,E)
mmshow(G)
![]() |
|
| G |
A simpler illustration can be computed using the color overlay facility of mmshow.
mmshow(F,Z2,Z1)
![]() |
|
| F,Z2,Z1 |
| [Up] [hoeq1s1] | |