Course: Machine Vision
Shape Features
Session 08
D5627 – I Gede Putra Kusuma Negara, B.Eng., PhD
Outline
• Thresholding
• Identifying Boundary
• Chain Code
• Fourier Descriptor
• Identifying Region
• Moments
Thresholding
Segmentation
• Segmentation: subdivides an image into its constituent region or
objects
• The purpose of image segmentation is to decompose the image into
parts that are meaningful with respect to a particular application
• Example, automatic PCB (printed circuit board) inspection,
Segmentation
• Segmentation is one of the most difficult tasks in image processing
• Segmentation accuracy determines the success or failure of
automated analysis procedure
• Considerable care should be taken to improve the probability of
rugged segmentation
Segmentation
Image segmentation generally are based on basic properties of intensity
values:
1. Discontinuity: partition an image based on abrupt changes in
intensity, such as edges
2. Similarity: partition image into regions that are similar according to
a set of predefined criteria
Thresholding
• Thresholding is a fundamental approach to segmentation
• Popular in applications where speed is an important factor
• Single value thresholding can be given mathematically as follows:






T
y
x
f
if
T
y
x
f
if
y
x
g
)
,
(
0
)
,
(
1
)
,
(
Thresholding (example)
• For example, we are going to build poker playing robot
• This robot should be able to visually interpret the card in its hand
What is the Correct Threshold?
• Wrong threshold leads to disastrous results
Basic Global Thresholding
• Partition the image histogram using a single global
threshold
• The basic global threshold, T, is calculated as follows:
1. Select an initial estimate for T (typically the average grey level
in the image)
2. Segment the image using T to produce two groups of pixels: G1
consisting of pixels with grey levels >T and G2 consisting pixels
with grey levels ≤ T
3. Compute the average grey levels of pixels in G1 to give μ1 and
G2 to give μ2
Basic Global Thresholding
4. Compute a new threshold value:
5. Repeat steps 2 – 4 until the difference in T in successive
iterations is less than a predefined limit T∞
• This algorithm works very well for finding thresholds when the
histogram is suitable
2
2
1 
 

T
Basic Global Thresholding
(example)
Problems with Single Value
Thresholding
• Single value thresholding only works for bimodal histograms
• Images with other kinds of histograms need more than a single
threshold
Thresholding (example)
• For example, we want to
isolate the contents
of the bottles
• Think about what the
histogram for this
image would look like
• Single threshold value can’t be used
in this problem
• The second picture shows the single
value thresholding result
Double Value Threshold
• We need a double value to
segment this kind of image
• There are two objects in this
image, bottle and liquid
• After we applied double
threshold value, we can
distinguish bottle and liquid
Identifying Boundary
Object Descriptor
• Objects are represented as a collection of pixels in an image
• To support the object recognition, we need to describe the
properties of group pixels  object descriptor
• Two forms of object descriptor:
1. Boundary descriptor: characterize an arrangement of pixels in
the object perimeter or boundary
2. Region descriptor: characterize an arrangement of pixels within
the area of the object
Important Properties
of Object Descriptor
1. Complete set: two objects must have the same descriptors if and only
if they have the same shape
2. Congruent: able to recognize similar objects when they have similar
descriptors
3. Convenient: they have invariant properties (position, rotation, scale,
or affine/perspective changes)
4. Compact set: represent the essence of an object in an efficient way
Boundary
• Boundary: a region describes contents that are surrounded
by a boundary (or perimeter)  region’s contour
• The boundary found by following the object contour:
– First, find one point on the contour
– Progress round the contour either in a clockwise/anticlockwise
direction, finding the nearest (or next) contour point.
Chain Code
• We can represents a contour with the coordinates of a sequence of
pixels in the image
• Alternatively, we can just store the relative position between
consecutive pixels. This is the basic idea behind chain code
• The set of pixels in the border of a shape is translated into a set of
connections between them
Chain Code: Example
Start Point Invariance
in Chain Code
• Chain code will be different when the start point changes
• We need start point invariance. This can be achieved by considering the
elements of the code to constitute the digits in an integer.
• We can shift the digits cyclically (replacing the least significant digit with
the most significant one, and shifting all other digits left one place).
Fourier Descriptor
• Let x[m] and y[m] be the coordinates of the m-th pixel on the boundary
of a given 2D shape containing pixels, a complex number can be formed
as z[m]=x[m]+jy[m], and the Fourier Descriptor (FD) of this shape is
defined as the DFT of z[m]:
• FD is independent of its location, scaling, rotation and starting point
• We could use M < N FDs corresponding to the low frequency
components of the boundary to represent the 2D shape
Z[k]= DFT[z[m]]=
1
N
z[m]e- j2pmk/N
m=0
N-1
å
Fourier Descriptor
(example)
25-Jun-21 Image Processing and Multimedia Retrieval 24
Original shape Reconstructed
Using 9 FD
Reconstructed
Using 19 FD
Reconstructed
Using 29 FD
Fourier Descriptor Properties
• Fourier descriptors inherit several properties from the Fourier transform.
• Translation invariant: no matter where the shape is located in the image,
the Fourier descriptors remain the same.
• Scaling invariant: if the shape is scaled by a factor, the Fourier descriptors
are scaled by that same factor.
• Rotation and starting point invariant: rotating the shape or selecting a
different starting point only affects the phase of the descriptors.
25-Jun-21 Image Processing and Multimedia Retrieval 25
Identifying Region
Region
There are two main region descriptors:
1. Basic: characterize the geometric properties of the region
2. Moment: characterize the density of the region
Basic Region Descriptors
• A region can be described by considering scalar measures based on its
geometric properties
Descriptor Formula
Area
Perimeter
Compactness
Dispersion
A(S) = I(x, y)DA
y

x

P(S) = (xi - xi-1)2
+(yi - yi-1)2
i
å
C(S) =
A(s)
P2
(s) / 4p
IR(S) =
max (xi - x)2
+(yi - y)2
( )
min (xi - x)2
+(yi - y)2
( )
Basic Region Descriptors
(example)
Moments
• Moments describe a shape’s layout, a bit like combining area,
compactness, irregularity, and higher-order descriptions together
• The moment of order p and q, mpq of a function I(x,y) is defined as
• Example
mpq = xp
yq
y

x
 I(x, y)DA
m00 = I(x, y)DA
y

x
 m10 = xI(x, y)DA
y

x
 m01 = yI(x, y)DA
y

x

Centralized Moments
• General formula:
• Example
• This moment descriptors are translation invariant
mpq = (x - x)p
(y - y)q
y

x
 I(x, y)DA
m01 = m01 -
m01
m00
m00
m10 = m01
m20 = m20 -
m10
2
m00
Centralized Moments: Example
Invariant Moments
• Centralized moments are only translation invariant
• Normalized central moments are invariant to translation, scale and
rotation
hpq =
mpq
m00
g
where g=
p + q
2
"p+ q ³ 2
Invariant Moments (cont.)
Invariant Moments: Example
Acknowledgment
Some of slides in this PowerPoint presentation are adaptation from
various slides, many thanks to:
1. Dr. Brian Mac Namee, School of Computing at the Dublin Institute
of Technology (http://www.comp.dit.ie/bmacnamee/gaip.htm)
2. James Hays, Computer Science Department, Brown University,
(http://cs.brown.edu/~hays/)
Thank You

More Related Content

PDF
PPT s11-machine vision-s2
PDF
PPT s06-machine vision-s2
PDF
PPT s12-machine vision-s2
PDF
PPT s04-machine vision-s2
PDF
LN s11-machine vision-s2
PDF
PPT s10-machine vision-s2
PDF
PPT s08-machine vision-s2
PDF
PPT s01-machine vision-s2
PPT s11-machine vision-s2
PPT s06-machine vision-s2
PPT s12-machine vision-s2
PPT s04-machine vision-s2
LN s11-machine vision-s2
PPT s10-machine vision-s2
PPT s08-machine vision-s2
PPT s01-machine vision-s2

What's hot (20)

PPT
Image segmentation
PDF
TYBSC (CS) SEM 6- DIGITAL IMAGE PROCESSING
PDF
Feature detection and matching
PDF
TYBSC (CS) SEM 6- DIGITAL IMAGE PROCESSING
PPTX
Segmentation Techniques -I
PPT
Image segmentation
PPSX
Edge Detection and Segmentation
PPTX
Image feature extraction
PDF
Image segmentation
PPTX
Image segmentation
PPT
Image segmentation
PPT
Dip Image Segmentation
PDF
Texture based feature extraction and object tracking
PPTX
Features image processing and Extaction
PPTX
Segmentation Techniques -II
PPTX
Image segmentation
PDF
Image Segmentation
PPT
Image segmentation
PPTX
Image segmentation in Digital Image Processing
Image segmentation
TYBSC (CS) SEM 6- DIGITAL IMAGE PROCESSING
Feature detection and matching
TYBSC (CS) SEM 6- DIGITAL IMAGE PROCESSING
Segmentation Techniques -I
Image segmentation
Edge Detection and Segmentation
Image feature extraction
Image segmentation
Image segmentation
Image segmentation
Dip Image Segmentation
Texture based feature extraction and object tracking
Features image processing and Extaction
Segmentation Techniques -II
Image segmentation
Image Segmentation
Image segmentation
Image segmentation in Digital Image Processing
Ad

Similar to PPT s07-machine vision-s2 (20)

PPT
ImSeg04 (2).ppt
PPT
ImSeg04.ppt
PPT
Im seg04
PDF
Unit-7 Representation and Description.pdf
PDF
Chap_9_Representation_and_Description.pdf
PDF
Chap_9_Representation_and_Description.pdf
PPTX
Computer Vision UNit 3 Presentaion Slide
PPTX
ACMP340.pptx
PPT
digital imagesegmentation-191212120951.ppt
PDF
SIRG-BSU_3_used-important.pdf
PDF
DIP Notes Unit-1 PPT.pdf
PPTX
Digital Image Processing Unit -2 Notes complete
PPTX
Image enhancement
PPTX
DIP Notes Unit-1 PPT , engineering, computer Science
PDF
Module 2 Computer Vision: Image Processing
PDF
Module-V 096.pdf
PPTX
Digital Image Processing Unit 2 ppt.pptx
PPTX
Various object detection and tracking methods
PDF
DTAM: Dense Tracking and Mapping in Real-Time, Robot vision Group
PPT
EDGEDETECTION algorithm and theory for image processing
ImSeg04 (2).ppt
ImSeg04.ppt
Im seg04
Unit-7 Representation and Description.pdf
Chap_9_Representation_and_Description.pdf
Chap_9_Representation_and_Description.pdf
Computer Vision UNit 3 Presentaion Slide
ACMP340.pptx
digital imagesegmentation-191212120951.ppt
SIRG-BSU_3_used-important.pdf
DIP Notes Unit-1 PPT.pdf
Digital Image Processing Unit -2 Notes complete
Image enhancement
DIP Notes Unit-1 PPT , engineering, computer Science
Module 2 Computer Vision: Image Processing
Module-V 096.pdf
Digital Image Processing Unit 2 ppt.pptx
Various object detection and tracking methods
DTAM: Dense Tracking and Mapping in Real-Time, Robot vision Group
EDGEDETECTION algorithm and theory for image processing
Ad

More from Binus Online Learning (20)

PDF
LN s12-machine vision-s2
PDF
LN s10-machine vision-s2
PDF
LN s09-machine vision-s2
PDF
LN s08-machine vision-s2
PDF
LN s07-machine vision-s2
PDF
LN s06-machine vision-s2
PDF
LN s05-machine vision-s2
PDF
LN s04-machine vision-s2
PDF
LN s03-machine vision-s2
PDF
LN s02-machine vision-s2
PDF
LN s01-machine vision-s2
PDF
PPT s09-machine vision-s2
PDF
PPT s05-machine vision-s2
PDF
PPT s03-machine vision-s2
PDF
PPT s02-machine vision-s2
PDF
LN sesi 2 delivering quality-1
PPTX
PPT Sesi 2 FO the guest delivering quality-1
PPTX
PPT Sesi 3 FO the guest - delivering quality 2
PDF
LN sesi 3 delivering quality-2
PDF
LN sesi 4 managing guest reservation-1
LN s12-machine vision-s2
LN s10-machine vision-s2
LN s09-machine vision-s2
LN s08-machine vision-s2
LN s07-machine vision-s2
LN s06-machine vision-s2
LN s05-machine vision-s2
LN s04-machine vision-s2
LN s03-machine vision-s2
LN s02-machine vision-s2
LN s01-machine vision-s2
PPT s09-machine vision-s2
PPT s05-machine vision-s2
PPT s03-machine vision-s2
PPT s02-machine vision-s2
LN sesi 2 delivering quality-1
PPT Sesi 2 FO the guest delivering quality-1
PPT Sesi 3 FO the guest - delivering quality 2
LN sesi 3 delivering quality-2
LN sesi 4 managing guest reservation-1

Recently uploaded (20)

PDF
Computer organization and architecuture Digital Notes....pdf
PDF
Lesson 3 .pdf
PDF
VSL-Strand-Post-tensioning-Systems-Technical-Catalogue_2019-01.pdf
PDF
Cryptography and Network Security-Module-I.pdf
PPTX
MAD Unit - 3 User Interface and Data Management (Diploma IT)
PDF
Beginners-Guide-to-Artificial-Intelligence.pdf
PPTX
AI-Reporting for Emerging Technologies(BS Computer Engineering)
PPTX
Environmental studies, Moudle 3-Environmental Pollution.pptx
PDF
VTU IOT LAB MANUAL (BCS701) Computer science and Engineering
PDF
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
PDF
August -2025_Top10 Read_Articles_ijait.pdf
PDF
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
PDF
Micro 4 New.ppt.pdf a servay of cells and microorganism
PPTX
Wireless sensor networks (WSN) SRM unit 2
PDF
Unit I -OPERATING SYSTEMS_SRM_KATTANKULATHUR.pptx.pdf
PDF
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
PPTX
CS6006 - CLOUD COMPUTING - Module - 1.pptx
PPTX
WN UNIT-II CH4_MKaruna_BapatlaEngineeringCollege.pptx
PPTX
Agentic Artificial Intelligence (Agentic AI).pptx
PPT
UNIT-I Machine Learning Essentials for 2nd years
Computer organization and architecuture Digital Notes....pdf
Lesson 3 .pdf
VSL-Strand-Post-tensioning-Systems-Technical-Catalogue_2019-01.pdf
Cryptography and Network Security-Module-I.pdf
MAD Unit - 3 User Interface and Data Management (Diploma IT)
Beginners-Guide-to-Artificial-Intelligence.pdf
AI-Reporting for Emerging Technologies(BS Computer Engineering)
Environmental studies, Moudle 3-Environmental Pollution.pptx
VTU IOT LAB MANUAL (BCS701) Computer science and Engineering
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
August -2025_Top10 Read_Articles_ijait.pdf
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
Micro 4 New.ppt.pdf a servay of cells and microorganism
Wireless sensor networks (WSN) SRM unit 2
Unit I -OPERATING SYSTEMS_SRM_KATTANKULATHUR.pptx.pdf
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
CS6006 - CLOUD COMPUTING - Module - 1.pptx
WN UNIT-II CH4_MKaruna_BapatlaEngineeringCollege.pptx
Agentic Artificial Intelligence (Agentic AI).pptx
UNIT-I Machine Learning Essentials for 2nd years

PPT s07-machine vision-s2

  • 1. Course: Machine Vision Shape Features Session 08 D5627 – I Gede Putra Kusuma Negara, B.Eng., PhD
  • 2. Outline • Thresholding • Identifying Boundary • Chain Code • Fourier Descriptor • Identifying Region • Moments
  • 4. Segmentation • Segmentation: subdivides an image into its constituent region or objects • The purpose of image segmentation is to decompose the image into parts that are meaningful with respect to a particular application • Example, automatic PCB (printed circuit board) inspection,
  • 5. Segmentation • Segmentation is one of the most difficult tasks in image processing • Segmentation accuracy determines the success or failure of automated analysis procedure • Considerable care should be taken to improve the probability of rugged segmentation
  • 6. Segmentation Image segmentation generally are based on basic properties of intensity values: 1. Discontinuity: partition an image based on abrupt changes in intensity, such as edges 2. Similarity: partition image into regions that are similar according to a set of predefined criteria
  • 7. Thresholding • Thresholding is a fundamental approach to segmentation • Popular in applications where speed is an important factor • Single value thresholding can be given mathematically as follows:       T y x f if T y x f if y x g ) , ( 0 ) , ( 1 ) , (
  • 8. Thresholding (example) • For example, we are going to build poker playing robot • This robot should be able to visually interpret the card in its hand
  • 9. What is the Correct Threshold? • Wrong threshold leads to disastrous results
  • 10. Basic Global Thresholding • Partition the image histogram using a single global threshold • The basic global threshold, T, is calculated as follows: 1. Select an initial estimate for T (typically the average grey level in the image) 2. Segment the image using T to produce two groups of pixels: G1 consisting of pixels with grey levels >T and G2 consisting pixels with grey levels ≤ T 3. Compute the average grey levels of pixels in G1 to give μ1 and G2 to give μ2
  • 11. Basic Global Thresholding 4. Compute a new threshold value: 5. Repeat steps 2 – 4 until the difference in T in successive iterations is less than a predefined limit T∞ • This algorithm works very well for finding thresholds when the histogram is suitable 2 2 1     T
  • 13. Problems with Single Value Thresholding • Single value thresholding only works for bimodal histograms • Images with other kinds of histograms need more than a single threshold
  • 14. Thresholding (example) • For example, we want to isolate the contents of the bottles • Think about what the histogram for this image would look like • Single threshold value can’t be used in this problem • The second picture shows the single value thresholding result
  • 15. Double Value Threshold • We need a double value to segment this kind of image • There are two objects in this image, bottle and liquid • After we applied double threshold value, we can distinguish bottle and liquid
  • 17. Object Descriptor • Objects are represented as a collection of pixels in an image • To support the object recognition, we need to describe the properties of group pixels  object descriptor • Two forms of object descriptor: 1. Boundary descriptor: characterize an arrangement of pixels in the object perimeter or boundary 2. Region descriptor: characterize an arrangement of pixels within the area of the object
  • 18. Important Properties of Object Descriptor 1. Complete set: two objects must have the same descriptors if and only if they have the same shape 2. Congruent: able to recognize similar objects when they have similar descriptors 3. Convenient: they have invariant properties (position, rotation, scale, or affine/perspective changes) 4. Compact set: represent the essence of an object in an efficient way
  • 19. Boundary • Boundary: a region describes contents that are surrounded by a boundary (or perimeter)  region’s contour • The boundary found by following the object contour: – First, find one point on the contour – Progress round the contour either in a clockwise/anticlockwise direction, finding the nearest (or next) contour point.
  • 20. Chain Code • We can represents a contour with the coordinates of a sequence of pixels in the image • Alternatively, we can just store the relative position between consecutive pixels. This is the basic idea behind chain code • The set of pixels in the border of a shape is translated into a set of connections between them
  • 22. Start Point Invariance in Chain Code • Chain code will be different when the start point changes • We need start point invariance. This can be achieved by considering the elements of the code to constitute the digits in an integer. • We can shift the digits cyclically (replacing the least significant digit with the most significant one, and shifting all other digits left one place).
  • 23. Fourier Descriptor • Let x[m] and y[m] be the coordinates of the m-th pixel on the boundary of a given 2D shape containing pixels, a complex number can be formed as z[m]=x[m]+jy[m], and the Fourier Descriptor (FD) of this shape is defined as the DFT of z[m]: • FD is independent of its location, scaling, rotation and starting point • We could use M < N FDs corresponding to the low frequency components of the boundary to represent the 2D shape Z[k]= DFT[z[m]]= 1 N z[m]e- j2pmk/N m=0 N-1 å
  • 24. Fourier Descriptor (example) 25-Jun-21 Image Processing and Multimedia Retrieval 24 Original shape Reconstructed Using 9 FD Reconstructed Using 19 FD Reconstructed Using 29 FD
  • 25. Fourier Descriptor Properties • Fourier descriptors inherit several properties from the Fourier transform. • Translation invariant: no matter where the shape is located in the image, the Fourier descriptors remain the same. • Scaling invariant: if the shape is scaled by a factor, the Fourier descriptors are scaled by that same factor. • Rotation and starting point invariant: rotating the shape or selecting a different starting point only affects the phase of the descriptors. 25-Jun-21 Image Processing and Multimedia Retrieval 25
  • 27. Region There are two main region descriptors: 1. Basic: characterize the geometric properties of the region 2. Moment: characterize the density of the region
  • 28. Basic Region Descriptors • A region can be described by considering scalar measures based on its geometric properties Descriptor Formula Area Perimeter Compactness Dispersion A(S) = I(x, y)DA y  x  P(S) = (xi - xi-1)2 +(yi - yi-1)2 i å C(S) = A(s) P2 (s) / 4p IR(S) = max (xi - x)2 +(yi - y)2 ( ) min (xi - x)2 +(yi - y)2 ( )
  • 30. Moments • Moments describe a shape’s layout, a bit like combining area, compactness, irregularity, and higher-order descriptions together • The moment of order p and q, mpq of a function I(x,y) is defined as • Example mpq = xp yq y  x  I(x, y)DA m00 = I(x, y)DA y  x  m10 = xI(x, y)DA y  x  m01 = yI(x, y)DA y  x 
  • 31. Centralized Moments • General formula: • Example • This moment descriptors are translation invariant mpq = (x - x)p (y - y)q y  x  I(x, y)DA m01 = m01 - m01 m00 m00 m10 = m01 m20 = m20 - m10 2 m00
  • 33. Invariant Moments • Centralized moments are only translation invariant • Normalized central moments are invariant to translation, scale and rotation hpq = mpq m00 g where g= p + q 2 "p+ q ³ 2
  • 36. Acknowledgment Some of slides in this PowerPoint presentation are adaptation from various slides, many thanks to: 1. Dr. Brian Mac Namee, School of Computing at the Dublin Institute of Technology (http://www.comp.dit.ie/bmacnamee/gaip.htm) 2. James Hays, Computer Science Department, Brown University, (http://cs.brown.edu/~hays/)