Documente Academic
Documente Profesional
Documente Cultură
Preprocess
Image acquisition, restoration, and enhancement
Intermediate process
Image segmentation and feature extraction
ISAN-DSP GROUP
Importance of Image Segmentation
Image segmentation is used to separate an image into constituent
parts based on some image attributes. Image segmentation is an
important step in image analysis
Benefit
1. Image segmentation reduces huge amount of unnecessary
data while retaining only importance data for image analysis
2. Image segmentation converts bitmap data into better
structured data which is easier to be interpreted
Image Attributes for Image Segmentation
1. Similarity properties of pixels inside the object are used to group
pixels into the same set.
2. Discontinuity of pixel properties at the boundary between object
and background is used to distinguish between pixels belonging to
the object and those of background.
Discontinuity:
Intensity change
at boundary
Similarity:
Internal
pixels share
the same
intensity
Spatial Filtering Application to Shape Detection
This mask will give the high response to the object that has the
similar shape as the mask such as isolated points.
Location of
porosity
X-ray image of the Laplacian image After thresholding
turbine blade with
porosity (Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Line Detection
There are several directions that the line in a digital image can be.
For a simple line detection, 4 directions that are mostly used are
Horizontal, +45 degree, vertical and –45 degree.
Absolute value
of result after Result after
processing with thresholding
-45 line detector
Blurred edge
Edge
Original image
Intensity
1 Edge Edge
0.8
Gray level profile 0.6
0.4
0.2
0
-0.2
-1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5
0.06 Minimum
0.04
0.02 point
The 1st derivative 0
-0.02
-0.04 Maximum
-0.5point
-0.06
-1.5 -1 0 0.5 1 1.5 2 2.5 3 3.5
x 10 -3 Zero
5
4
3
crossing
2
1
+ +
The 2nd derivative 0
-1 - -
-2
-3
-4
-5
-1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5
Derivative Based Edge Detection
Derivative operator is
f(x) df d2 f
a highpass filter and
dx dx 2 thus enhances noise.
AWGN s = 0.1
Edge responses
AWGN s = 1.0
are buried by
noise.
AWGN s = 10
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Masks for Estimating Partial Derivatives
f ( x, y ) f
y
f f f
x x y
f f f
x x y
x y
s 4
Surface plot of
LOG, Looks like
a “Mexican hat” LOG image
200
100
2. T1 Average( p( x, y ) p( x, y ) T )
3. T2 Average( p( x, y ) p( x, y ) T )
T1 T2
4. T
2
5. Repeat step 2
Automatic Threshold Level Selection Example
150
T2 = 196
100
50
T3 = 228
0
Illumination
Function i(x,y)
Image histogram
f(x,y)
Local thresholding:
1. Divide an image into subimages.
2. Threshold each subimage independently
2.1 Compute histogram of each subimage and select a suitable
threshold value for each subimage
2.2 threshold each subimage using a threshold value in 2.1
2.3 Combine all local thresholding results
Error
900
800
700
600
500
400
300
200
100
T=0.4
Error edges
ISAN-DSP GROUP
Optimum Thresholding
Background
p1(z) = PDF of object pixels
Object p2(z) = PDF of background pixels
1 2
3 4
Saturation Intensity
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Color Segmentation in HSI Color Space (cont.)
Binary thresholding of S component Product of 2 and 5
with T = 10%
5 6
Red pixels
7 8
Histogram of 6 Segmentation of (Images
red color
from Rafaelpixels
C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Color Segmentation in HSI Color Space (cont.)
1 if D (c( x, y ), cT ) T
g ( x, y )
0 if D (c( x, y ), cT ) T
cT = color to be segmented.
D(u,v) = distance function c(x,y) = RGB vector at pixel (x,y).
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Example: Segmentation in RGB Vector Space
Color image
Results of segmentation in
RGB vector space with Threshold
value
T = 1.25 times the SD of R,G,B values
In the box
1
Blue
0.5
0
1
0.2 0.8
0.4 0.6
0.6
0.4
From www.jpl.nasa.gov/radar/ 0.8
0.2
sircxsar/munch.html 1 Green
Red
Feature Space (RGB)
Self Organizing Map for Color Image Segmentation
We can use the Self Organizing Map (SOM) to calculate the right colors to use.
In the separate components of color pixels.
Advantages
Because this method uses the properties of a single pixel.
Not much needs to be calculated. And spent a disadvantage
Do not apply to image noise. And the brightest
The results are often inconsistent and incoherent picture.
ISAN-DSP GROUP
Region Oriented Image Segmentation
As a way to separate the components of the image based on
the position of the pixels and the same.
Features of the pixel area If adjacent pixels and features are identical.
To the same group
The advantage of doing this is an area where continued.
P
Connected
pixels
Pixel P and
its neighbors
Region Growing Algorithm
Area expanded
ISAN-DSP GROUP
Region Growing Image Segmentation Example
Region growing by example
MLB combination
If the intensity of adjacent pixels.
Light of the current maximum of four pixels.
Arranged in the same
Begin
from within
finished
the edge
ISAN-DSP GROUP
Region Growing Image Segmentation Example
Histogram
Region Splitting
1. Initial divided into sub-images.
ISAN-DSP GROUP
Quadtree for Region Splitting Representation
Region Splitting
ISAN-DSP GROUP
Region Splitting Example
original size
ISAN-DSP GROUP
Region Merging Example
original size
ISAN-DSP GROUP
Edge Oriented Image Segmentation
As a way to separate the discrete elements of the live image.
(Discontinuity) of features of the pixels at the interface between
the subject and the background. This approach is aimed primarily
at the edges of objects.
The end result of this approach is on the borderline between different areas
The continuation of
Color stitching
ISAN-DSP GROUP
Smoothed Step Edge and Its Derivatives
1.2
Intensity
1 Edge Edge
0.8
Gray level profile 0.6
0.4
0.2
0
-0.2
-1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5
0.06 Minimum
0.04
0.02
point
The 1st derivative 0
-0.02
-0.04 Maximum
-0.5point
-0.06
-1.5 -1 0 0.5 1 1.5 2 2.5 3 3.5
x 10 -3 Zero
5
4
3
crossing
2
1
+ +
The 2nd derivative 0
-1 - -
-2
-3
-4
-5
-1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5
Derivative Based Edge Detection
้ ้น P P P
ภาพตังต P
x y
Gradient Vector Field
Gradient Vector is a quantity that describes
the size and orientation of the object.
้ ้น
ภาพตังต
Gradient P ้ วของ
พืนผิ P
Vector P บริเวณขอบมีลกั ษ
Field เหมือนสันเขา ตาแหน
ขอบคือสันเขา
Gradient Based Image Segmentation
้ ้น
ภาพตังต
P
P|
Thresholding
ใช ้ T มีคา่ สูงไ
จะได ้ขอบทีข ่
Edge map บริเวณมุม
ใช ้ T มีคา่ ต่าไป
จะได ้ขอบทีหนา่ T=60 T=100
Laplacian Image
่ ยวข
Operator ทีเกี ่ ้องกับอนุ พน
ั ธ ์อันดับ 2 ของภาพ 2 มิต ิ คือ Gradient
Operator ( 2 )
่
ซึงสามารถใช ้ในการตรวจจั บขอบได ้
2
P 2
P
2 P 2 2
x y
้ ้น P
ภาพตังต 2 P 2 P
2 P
x 2 y 2
Laplacian Image
่
เครืองหมายของ ่
เครืองหมายของ
2 P เป็ นลบ 2 P เป็ นบวก
ภายนอกวัตถุ ภายในวัตถุ
้ ้น P
ภาพตังต 2 P
้
พืนผิวของP
2
Laplacian Based Image Segmentation
้ ้น
ภาพตังต
2 P 2 P
Zero
Crossing
Detection Zero crossing
Detection ทาได ้
โดยทา thresholding
Edge map กับ 2 P โดยใช ้ T=0
Laplacian
ขยายสัญญาณรบกวน
ให ้ช ัดเจนขึน้ ISAN-DSP GROUP
Gradient VS Laplacian
Gradient Laplacian
P 2P
ผลตอบสนองต่อขอบ Local Extrema Zero Crossing
แบบขัน้ of |P|
(step edge) ของวัตถุ
ความสาคัญ บอกถึงทิศทาง บอกถึงตาแหน่ ง
และขนาดของ ของขอบของวัตถุ
ขอบของวัตถุ
การตรวจจับขอบ Thresholding Zero Crossing
|P| Detection
จุดอ่อน ผลลัพธ ์มักได ้ มักไม่ทนทานต่อ
่
edge map ทีไม่ สัญญาณรบกวน
สมบูรณ์
ISAN-DSP GROUP
Boundary Extraction Based on Particle motion in a Vector Field
Gradient field Tangential velocity field
pk pk 1 ek 1
pk ตาแหน่ งปัจจุบน ่
ั ของอนุ ภาคทีเว
่
pk 1 ตาแหน่ งในอดีตของอนุ ภาคทีเว
ek 1 edge vector field ณ ตาแหน
ที่ pk 1
ค่าคงที่ > 0
่ ้นของอนุ ภาค
ตาแหน่ งเริมต
ผลลัพธ ์: ใน edge vector field อนุ ภาคโคจรรอบวัตถุมรี ะยะห่างจา
้ อยๆ
ขึนเรื ่ จนเกิดทางเดินรูปก ้นหอย (spiral trajectory)
Example: Particle Trajectory in an Edge Vector Field
้ ้น
ภาพตังต P
P0
P 2 P n
Example: Normal
A Normal Compressive
compressive velocity field
Vector Field
1
n P 2 P
c
ISAN-DSP GROUP
Combined Vector Field
t+n
v e n
v มีลก
ั ษณะลูเ่ ข ้าสูข
่ อ
และไหลวนรอบวัตถุ
ISAN-DSP GROUP
Particle Trajectory in a Combined Vector Field
อนุ ภาคโคจรรอบวัตถุตาม
เส ้นทางเดียว
เราสามารถแกะรอยเ
ขอบของวัตถุได ้จากทาง
ของอนุ ภาค
่ ้นของอนุ ภา
ตาแหน่ งเริมต
Example: Particle Trajectory in a Combined Vector Field
Particle trajectory
P0 pk pk 1 ek 1 nk 1
ถ ้าใหอ้ นุ ภาคเดินไปในทิศทางเดียว
่ สมบูรณ์
จะมีโอกาสได ้เส ้นขอบทีไม่ ISAN-DSP GROUP
Boundary Extraction Algorithm Based on Particle
Motion in a Vector Field
่
1. เลือก Mask ทีเหมาะสมในการค านวณ Gradient และ Laplacian
ของภาพ
2. คานวณ edge vector field และ normal compressive vector fie
่ ้นใหอ้ นุ ภาค ณ ตาแหน่ ง Local maxima
3. กาหนดตาแหน่ งเริมต
ของ
Gradient magnitude
4. แกะรอยเส image นของอนุ ภาค
้นขอบตามทางเดิ
่
5. หยุดการทางานเมืออนุ ภาคเดินกลับมาทีจุ่ ดเริมต
่ ้นหรือพบกับเส ้น
่
ขอบทีเคยผ่ านมาแล ้ว
ISAN-DSP GROUP
Boundary Extraction Example
ISAN-DSP GROUP
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Edge Linking