Tải bản đầy đủ (.pdf) (61 trang)

chapter 9 erossion

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.81 MB, 61 trang )

Morphology in image processing
Morphology in image processing
 Morphology generally concerned with shape
and properties of objects.
 Used for segmentation and feature extraction.
 Segmentation = used for cleaning binary
objects.
 Two basic operations
 erosion
 dilation
Digital Image Processing
Erosion and Dilation
Dilation and Erosion
 DILATION: Adds pixels to the boundary of
an object
 EROSION: Removes pixels from the
boundary of an object
 Number of pixels added or removed
depends on size and shape of structuring
element
Morphological operators are used to prepare
binary images for object segmentation,
recognition
Binary images often suffer from noise
(specifically salt-and-pepper noise)
Binary regions also suffer from noise (isolated
black pixels in a white region). Can also have
cracks, picket fence occlusions, etc.
Dilation and erosion are two binary
morphological operations that can assist with
these problems.


Morphology in image processing
Morphology in image processing
A is a set in Z2 ,
a=(a1,a2) an element of A, a∈A If not, then
a∉A
∅: null (empty) set
A subset of B: A⊆B
Union of A and B: C=A∪B
Intersection of A and B: D=A∩B
Disjoint sets: A∩B= ∅
Complement of A: Ac = {x|x∉A}
Difference of A and B:
A-B = {x|x ∈ A, x ∉ B} = A ∩Bc
Structuring Elements, Hits & Fits
B
A
C
Structuring Element
Fit: All on pixels in the
structuring element cover
on pixels in the image
Hit: Any on pixel in the
structuring element covers
an on pixel in the image
All morphological processing operations are based
on these simple ideas
Structuring Elements
Structuring elements can be any size and
make any shape
However, for simplicity we will use

rectangular structuring elements with their
origin at the middle pixel
1 1 1
1 1 1
1 1 1
0 0 1 0 0
0 1 1 1 0
1 1 1 1 1
0 1 1 1 0
0 0 1 0 0
0 1 0
1 1 1
0 1 0
Fitting & Hitting
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 1 0 0 0 0 0 0 0
0 0 1 1 1 1 1 0 0 0 0 0
0 1 1 1 1 1 1 1 0 0 0 0
0 1 1 1 1 1 1 1 0 0 0 0
0 0 1 1 1 1 1 1 0 0 0 0
0 0 1 1 1 1 1 1 1 0 0 0
0 0 1 1 1 1 1 1 1 1 1 0
0 0 0 0 0 1 1 1 1 1 1 0
0 0 0 0 0 0 0 0 0 0 0 0
B
C
A
1 1 1
1 1 1
1 1 1

Structuring
Element 1
0 1 0
1 1 1
0 1 0
Structuring
Element 2
Fundamental Operations
Fundamentally morphological image
processing is very like spatial filtering
The structuring element is moved across
every pixel in the original image to give a
pixel in a new processed image
The value of this new pixel depends on the
operation performed
There are two basic morphological
operations: erosion and dilation
Erosion
Erosion of image f by structuring element s
is given by f  s
The structuring element s is positioned with
its origin at (x, y) and the new pixel value is
determined using the rule:



=
otherwise 0
fits if 1
),(

fs
yxg
Example for Erosion
1101110001
Input image
Structuring Element
x7x6x5x4x1x3x2x1
Output Image
111
Erosion Example
Structuring Element
Original Image
Processed Image With Eroded Pixels
Erosion Example
Structuring Element
Original Image
Processed
Image
Example : Erosion
d
d
x
y
2
y
2
y
2
x
2

x
Erosion Example
A
Erosion Example
Erosion Example
Erosion Example
Erosion Example
clc
clear all
A=zeros(100);
A(5:8,85:88)=1;
A(35:45,85:95)=1;
A(30:40, 50:60)=1;
A(80:85, 50:55)=1;
A(5:15,5:15)=1;
A(70:80, 25:35)=1;
A(90:95, 40:45)=1;
B=ones(8);
A=logical(A);
B=logical(B);
subplot(1, 2, 1)
imshow(A), title('original Image', 'FontSize',14)
C=imerode(A, B);
subplot(1, 2, 2),imshow(C), title('Erode by ones(8)', 'FontSize',14)
Erosion Example 2
Original
image
After erosion
with a disc of
radius 10

After erosion
with a disc of
radius 20
After erosion
with a disc of
radius 5
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Dilation
Dilation of image f by structuring element s is
given by f s
The structuring element s is positioned with
its origin at (x, y) and the new pixel value is
determined using the rule:




=
otherwise 0
hits if 1
),(
fs
yxg
Example for Erosion
1101110001
Input image
Structuring Element
x3x2x1
Output Image
111

Dilation Example
Structuring Element
Original Image
Processed Image
Dilation Example
Structuring Element
Original Image
Processed Image With Dilated Pixels
Dilation Example

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×