Professional Documents
Culture Documents
C6 - P1 - Image Segmentation - NTHai-6-2020
C6 - P1 - Image Segmentation - NTHai-6-2020
Lecture:
IMAGE PROCESSING
Chapter 6:
Image Segmentation
1
Assoc. Prof. Nguyen Thanh Hai, PhD
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Image Segmentation
2
Assoc. Prof. Nguyen Thanh Hai
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Image Segmentation
Example of Image
segmentation
3
Assoc. Prof. Nguyen Thanh Hai
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Image Segmentation
- Figure has three regions (0-
100), (100-150), (150-210)
- (100-150) can be threshold
region
- (0-100) can be background
region
- (150-210) can be object
region
Segmentation based on brightness
4
Assoc. Prof. Nguyen Thanh Hai
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Image Segmentation
a f ( x, y ) T1
g ( x, y ) b T2 f ( x, y ) T1
c f ( x, y ) T
Assoc. Prof. Nguyen Thanh Hai
2
5
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Image Segmentation
Segmentation based on brightness
close all;clear all;
%%% Segmentation of Original image
Fingureprint image
I=
imread('SegFigureprint.jpg');
%I1=rgb2gray(I);
figure(1),imshow(I)
T=100;
g = im2bw(I,T/255 );
figure(2), imhist(I)
figure(3), imshow(J)
T=120 Histogram 6
Assoc. Prof. Nguyen Thanh Hai
T=100
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Image Segmentation
T = 116.5485
Count=2, dt=0.5 9
Assoc. Prof. Nguyen Thanh Hai T = 112.7171
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Image Segmentation
10
Assoc. Prof. Nguyen Thanh Hai
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Image Segmentation
For example,
The algorithm will be demonstrated using the simple
6x6 image shown below. The histogram for the image
is shown next to it. To simplify the explanation, only 6
greyscale levels are used.
0 0 1 4 4 5
0 1 3 4 3 4
1 3 4 2 1 3
4 4 3 1 0 0
5 4 2 1 0 0
5 5 4 3 1 0
11
Assoc. Prof. Nguyen Thanh Hai
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Image Segmentation
14
Assoc. Prof. Nguyen Thanh Hai
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Image Segmentation
15
Assoc. Prof. Nguyen Thanh Hai
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Image Segmentation
Segmentation based on histogram threshold
close all;clear all;clc;
I = imread('SegFigureprint.jpg');
figure(1),imshow(I);
figure(2),imhist(I); % display the Histogram
%%=================================================
n=imhist(I); % Compute the histogram
N=sum(n); % sum the values of all the histogram values
max=0; %initialize maximum to zero
%%=====================================
for i=1:256
P(i)=n(i)/N; %Computing the probability of each intensity
level
end
16
Assoc. Prof. Nguyen Thanh Hai
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Image Segmentation
17
Assoc. Prof. Nguyen Thanh Hai
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Image Segmentation
T = 112
18
Assoc. Prof. Nguyen Thanh Hai
HCMC University of Technology and Education
Faculty of Electrical & Electronic Engineering Image Segmentation
The End
19
Assoc. Prof. Nguyen Thanh Hai