Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 8

HCMC University of Technology and Education

Faculty of Electrical & Electronic Engineering

Lecture: IMAGE PROCESSING


Chapter 8: Morphological Image Processing
EROSION METHOD

1
Assoc. Prof. Nguyen Thanh Hai, PhD
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Morphological Image Processing

Erosion

(A()B)={c | (B)c  A)

Formula for erosion, in which a is pixel, b is one SE in SE matrix,


c denotes pixel of the output image after erosion

2
Assoc. Prof. Nguyen Thanh Hai, PhD
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Morphological Image Processing

For example of Erosion

E(i)=(A()B)(x,y)=min(A(x+i, y+i)+B(i,j) | (i,j)DB)


- A is the image matrix with gray pixel.
- B is the SE with elements structured to follow gray levels

3
Assoc. Prof. Nguyen Thanh Hai, PhD
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Morphological Image Processing

Erosion: subtract 10 related to element in SE

Choosing central pixel based on


SE

4
Assoc. Prof. Nguyen Thanh Hai, PhD
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Morphological Image Processing

Choosing pixel with the smallest value, we have

- All pixels in the image A are subtracted by 10 chosen as in the


SE B.
- Choose pixel group with values (non-zero) having the
structure corresponding to the SE B.
- Choose the smallest value in that structure to be the
corresponding value in the image C. 5
Assoc. Prof. Nguyen Thanh Hai, PhD
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Morphological Image Processing

Examples for erosion

6
Assoc. Prof. Nguyen Thanh Hai, PhD
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Morphological Image Processing

Code for erosion


A = imread('text.png');
B = strel('line',11,90);
C = imerode(A,B);
imshow(C);

7
Assoc. Prof. Nguyen Thanh Hai, PhD
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Morphological Image Processing

The End

8
Assoc. Prof. Nguyen Thanh Hai, PhD

You might also like