SlideShare a Scribd company logo
Image Processing (KCS-062):
Unit-5: Image compression, Representation, Pattern
classes and Matching
Dr. Radhey Shyam
Professor
Department of Computer Science and Engineering
BIET Lucknow
(Affiliated to Dr. A.P.J. Abdul Kalam Technical University
Unit-5 have been compiled/prepared by Dr. Radhey Shyam, with grateful acknowledgment who made their
course contents freely available. Feel free to use this study material for your own academic purposes. For
any query, the communication can be made through my mail shyam0058@gmail.com.
Course Outcome of Unit-5, the students will be able to explain the basic concepts of Image
compression,Representation, and Pattern classes and Matching.
Date: July 17, 2021
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
01/12/2020
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Representation & Description
Representation & Description
The results of segmentation is a set of regions. Regions are then
represented (often univocally) and described (often non-univocally)
Two main ways of representing a region:
- external characteristics (its boundary): focus on shape and size
- internal characteristics (its internal pixels): focus on color, textures…
The next step: description
E.g.: a region may be represented by its boundary, and its boundary
described by some features such as length, regularity…
- Features should be insensitive to translation, rotation, and scaling.
- Both boundary and regional descriptors are often used together.
Copyright notice: Most images in these slides are
© Gonzalez and Woods, Digital Image Processing, Prentice-Hall
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Representation of boundaries
Representation of boundaries
Hypotheses: binary images, objects do not touch the image border
(padding if necessary), one object at a time
To represent a boundary, it is useful to compact the raw data (list of
boundary pixels coordinates) 
Boundary following: start at the first boundary position in (e.g.)
lexicographic ordering and build a chain code
Chain codes: list of segments with defined length and direction
• 4-directional chain codes
• 8-directional chain codes
- At each boundary pixel,
circularly inspect the
neighbourhood until a new
boundary pixel is found
- Stop when contour closes
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Representation of boundaries
Representation of boundaries
Simplify
It may be useful to downsample the border image before computing
the chain code
• to reduce the code size
• to remove useless details along the boundary
Can be conveniently done during the boundary following process: at
each step the large-grid node is selected which is closest to a boundary
point
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Representation of boundaries
Representation of boundaries
• To make the code independent of the starting point:
the code is a circular sequence; the starting point is defined as the
one which yields a sequence of numbers that together represent
the smallest possible integer
E.g., 10103322  01033221
• To normalize wrt rotation (in 90 deg. or 45 deg. steps):
first differences (no. of direction changes) can be used
E.g., 10103322  3133030 (counting ccw)
and pre-pending the last transition (circular sequence: 2  1 = 3)
 33133030
(shape number, see later)
01/12/2020
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Representation of a shape
Representation of a shape
Skeletons represent (non-univocally) a shape by reducing it to a graph
Medial axis transform (Blum 1967):
points that have more than one closest boundary points.
Also built using a prairie fire process
• object is a field of dry grass
• fire is simultaneously lit along the boundary
• fire propagates at uniform velocity
• skeleton is the set of quench points, where two independent fire-fronts
meet
Highly sensitive
to small details
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Representation of a shape
Representation of a shape
Skeletons represent (non-univocally) a shape by reducing it to a graph
Digital approaches can simulate the grassfire propagation using
• iterative constrained erosion process
• centers of maximal balls in distance-transform domain (together with
their radii, they permit exact reconstruction of the object)
• centers of the enclosed balls that touch the object boundary at two or
more disjoint locations.
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Boundary descriptors
Boundary descriptors
Simple descriptors:
• length
e.g., for 8-connected chain code:
horiz. components + vert. components + 21/2 diag. components
• order
no. ef elements in the code (same as above without 21/2 factor)
• diameter
length of the major axis: max(D(pi,pj)) where D is a distance and
pi , pj are points on the boundary. The minor axis is orthogonal to
the major axis, and has length [no matter its position] that permits
to determine the
• basic rectangle that minimally encloses the boundary
• eccentricity of the basic rectangle (major/minor axes ratio)
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Boundary descriptors
Boundary descriptors
• shape number: first-difference code of smallest magnitude
(treating the chain code as a circular sequence)
All the shapes of
order 4, 6, 8
The dot is the
starting point
01/12/2020
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Boundary descriptors
Boundary descriptors
Steps in the
generation of a shape
number
It is advisable to
normalize the grid
orientation by aligning
the chain code grid to
the basic rectangle
(note: poor drawing of
the basic rectangle in
this fig., or may indicate
small set of available
discrete orientations)
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Boundary descriptors
Boundary descriptors
• 1-D Fourier descriptors
the sequence of boundary points is treated as a sequence of points in
the complex plane
- It becomes a complex 1-D descriptor
- Can be DFT-transformed
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Boundary descriptors
Boundary descriptors
Different approximated descriptions are obtained by dropping some
DFT coefficients
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Boundary descriptors
Boundary descriptors
01/12/2020
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Boundary descriptors
Boundary descriptors
Fourier descriptors are not insensitive to translation etc.,
but their effects on the transform coefficients are known:
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Boundary descriptors
Boundary descriptors
• Statistical moments
A portion of a boundary can be described as a 1-D function
(stopping when the distance from the origin stops growing)
Then, statistical moments (mean, variance, skewness, kurtosis, …)
can be used to describe it
• Treat g(r) as a discrete r.v. v in the range [0, A-1] (quantized
levels on the g(r) axis above), having a pdf p(vi)
• Its n-th central moment is
mn(v)=Si (vi-m)n p(vi)
where m = Si vi p(vi)
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Regional descriptors
Regional descriptors
Some simple descriptors
• area
• compactness = perimeter2/area
(dimensionless  insensitive to
scale)
- In this figure:
(white area) / (total light area)
gives an idea of relative electrical
energy consumption
(should be normalized by land/sea
fraction in image, or by population
density)
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Regional descriptors
Regional descriptors
Topology (maths) is the study of the region properties which are
unaffected by rubber-sheet deformations (non-Euclidean geometry)
[like in many subway maps]
[http://www.rrb.wayne.edu/topology.html]
• number of holes H
• number of connected components C
• Euler number, E = C - H
01/12/2020
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Regional descriptors
Regional descriptors
Textures can be analyzed by statistical descriptors in terms of
smoothness, coarseness, regularity …
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Regional descriptors:
some statistical descriptors
Regional descriptors:
some statistical descriptors
- Statistical (central) moments mn(z) = Si (zi-m)np(zi)
of the gray-level histogram p(zi)
- Activity index R R = 1 - 1/(1+s 2)
(R=0 in flat areas,  1 in very active ones)
- Uniformity U U = Si p2(zi)
(max. if gray levels are equally distributed)
- Entropy e e = - Si p(zi) log2 p(zi)
(is 0 for a constant image)
[R, U, and e provide approx. the same information]
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Regional descriptors
Regional descriptors
Moments of the image as a 2-D function
Moment: mpq= SxSy xp yq f (x,y)
Central moment: mpq= SxSy (x-x’)p (y-y’)q f(x,y)
with x’= m10 / m00 and y’= m01 / m00
If we define the normalized central moments
hpq = mpq / m00
g with g = (p+q)/2 + 1
seven invariant moments can be defined, e.g.
f1 = h20h02
f2 = (h20-h02)2 + 4h11
2
…
which are invariant to translation, rotation, scaling, and mirroring
(but for a sign change)
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Regional descriptors
Regional descriptors
01/12/2020
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Regional descriptors
Regional descriptors
Fourier spectrum features:
- amplitude of peaks gives principal directions of the patterns
- location of maximum peak(s) gives the fundamental period(s)
- periodic components can be removed via filtering; the remaining
non-periodic image can be analyzed using statistical techniques
The spectrum can be also studied in polar coordinates: S(r,q)
For each pair r,q we can have two descriptors:
S(r) = Sq Sq(r) S(q ) = Sr Sr(q )
see also:
z11_Shape-based image retrieval using generic Fourier descriptor
Matlab Central 2016:
FD = gfd(bw,m,n) - Implementation of the Generic Fourier Descriptors
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Regional descriptors
Regional descriptors
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Next step: use features for segmentation / classification
Next step: use features for segmentation / classification
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
Next step: use features for segmentation / classification
Next step: use features for segmentation / classification
01/12/2020
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
…or use Deep Learning for segmentation / classification
…or use Deep Learning for segmentation / classification
Gianni Ramponi
http://www.units.it/ramponi Digital Image Processing
…or use Deep Learning for segmentation / classification
…or use Deep Learning for segmentation / classification
 Dip11a, b
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5
Ip unit 5

More Related Content

PDF
Kernels in convolution
PPTX
Simple overview of machine learning
PPTX
Computer system architecture
PDF
Performance Metrics for Machine Learning Algorithms
PDF
Evaluating web conference_tools
PPTX
Neural network & its applications
PPT
Image enhancement ppt nal2
PPTX
Walsh transform
Kernels in convolution
Simple overview of machine learning
Computer system architecture
Performance Metrics for Machine Learning Algorithms
Evaluating web conference_tools
Neural network & its applications
Image enhancement ppt nal2
Walsh transform

What's hot (20)

PPTX
Distributed file system
PPTX
Machine Learning-Linear regression
DOCX
Big data lecture notes
PPTX
Network Attached Storage (NAS)
PPTX
Unit 1 - ML - Introduction to Machine Learning.pptx
PPTX
Single image haze removal
PPTX
Mobile computing
PPT
Interpixel redundancy
PPTX
Cloud computing using Eucalyptus
PDF
Supervised Machine Learning Algorithm
PPTX
Artificial neural network
PPTX
RapidMiner: Introduction To Rapid Miner
PPTX
Convolution Neural Network (CNN)
PPT
Data mining :Concepts and Techniques Chapter 2, data
PPT
3.2 partitioning methods
PPTX
5 v of big data
PPTX
SDN( Software Defined Network) and NFV(Network Function Virtualization) for I...
PPTX
Machine learning session4(linear regression)
PPTX
Open Cloud Consortium Overview (01-10-10 V6)
PDF
Lecture6 introduction to data streams
Distributed file system
Machine Learning-Linear regression
Big data lecture notes
Network Attached Storage (NAS)
Unit 1 - ML - Introduction to Machine Learning.pptx
Single image haze removal
Mobile computing
Interpixel redundancy
Cloud computing using Eucalyptus
Supervised Machine Learning Algorithm
Artificial neural network
RapidMiner: Introduction To Rapid Miner
Convolution Neural Network (CNN)
Data mining :Concepts and Techniques Chapter 2, data
3.2 partitioning methods
5 v of big data
SDN( Software Defined Network) and NFV(Network Function Virtualization) for I...
Machine learning session4(linear regression)
Open Cloud Consortium Overview (01-10-10 V6)
Lecture6 introduction to data streams
Ad

Similar to Ip unit 5 (20)

PPTX
"FingerPrint Recognition Using Principle Component Analysis(PCA)”
PDF
Module-5-1_230523_171754 (1).pdf
PPT
3D Graphics
PPTX
DeepFak.pptx asdasdasdasdasdasdasdasdasd
PDF
Module 2 Computer Vision: Image Processing
PDF
427lects
PDF
Enhanced Optimization of Edge Detection for High Resolution Images Using Veri...
PPS
A Tutorial On Ip 1
PDF
The Explanation the Pipeline design strategy.pdf
PPTX
DEEP LEARNING TECHNIQUES POWER POINT PRESENTATION
PDF
License plate recognition
PPTX
representation.pptx
PDF
SEGMENTATION AND RECOGNITION OF HANDWRITTEN DIGIT NUMERAL STRING USING A MULT...
PDF
Segmentation and recognition of handwritten digit numeral string using a mult...
PDF
SEGMENTATION AND RECOGNITION OF HANDWRITTEN DIGIT NUMERAL STRING USING A MULT...
PDF
Real time-image-processing-applied-to-traffic-queue-detection-algorithm
PPTX
ACMP340.pptx
PPTX
project_final
"FingerPrint Recognition Using Principle Component Analysis(PCA)”
Module-5-1_230523_171754 (1).pdf
3D Graphics
DeepFak.pptx asdasdasdasdasdasdasdasdasd
Module 2 Computer Vision: Image Processing
427lects
Enhanced Optimization of Edge Detection for High Resolution Images Using Veri...
A Tutorial On Ip 1
The Explanation the Pipeline design strategy.pdf
DEEP LEARNING TECHNIQUES POWER POINT PRESENTATION
License plate recognition
representation.pptx
SEGMENTATION AND RECOGNITION OF HANDWRITTEN DIGIT NUMERAL STRING USING A MULT...
Segmentation and recognition of handwritten digit numeral string using a mult...
SEGMENTATION AND RECOGNITION OF HANDWRITTEN DIGIT NUMERAL STRING USING A MULT...
Real time-image-processing-applied-to-traffic-queue-detection-algorithm
ACMP340.pptx
project_final
Ad

More from Dr. Radhey Shyam (20)

PDF
KIT-601 Lecture Notes-UNIT-5.pdf Frame Works and Visualization
PDF
KIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and Clustering
PDF
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
PDF
IT-601 Lecture Notes-UNIT-2.pdf Data Analysis
PDF
KIT-601-L-UNIT-1 (Revised) Introduction to Data Analytcs.pdf
PDF
SE-UNIT-3-II-Software metrics, numerical and their solutions.pdf
PDF
Introduction to Data Analytics and data analytics life cycle
PDF
KCS-501-3.pdf
PDF
KIT-601 Lecture Notes-UNIT-2.pdf
PDF
KIT-601 Lecture Notes-UNIT-1.pdf
PDF
KCS-055 U5.pdf
PDF
KCS-055 MLT U4.pdf
PPTX
Deep-Learning-2017-Lecture5CNN.pptx
PDF
SE UNIT-3 (Software metrics).pdf
PDF
SE UNIT-2.pdf
PDF
SE UNIT-1 Revised.pdf
PDF
SE UNIT-3.pdf
PDF
Ip unit 4 modified on 22.06.21
PDF
Ip unit 3 modified of 26.06.2021
PDF
Ip unit 2 modified on 8.6.2021
KIT-601 Lecture Notes-UNIT-5.pdf Frame Works and Visualization
KIT-601 Lecture Notes-UNIT-4.pdf Frequent Itemsets and Clustering
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
IT-601 Lecture Notes-UNIT-2.pdf Data Analysis
KIT-601-L-UNIT-1 (Revised) Introduction to Data Analytcs.pdf
SE-UNIT-3-II-Software metrics, numerical and their solutions.pdf
Introduction to Data Analytics and data analytics life cycle
KCS-501-3.pdf
KIT-601 Lecture Notes-UNIT-2.pdf
KIT-601 Lecture Notes-UNIT-1.pdf
KCS-055 U5.pdf
KCS-055 MLT U4.pdf
Deep-Learning-2017-Lecture5CNN.pptx
SE UNIT-3 (Software metrics).pdf
SE UNIT-2.pdf
SE UNIT-1 Revised.pdf
SE UNIT-3.pdf
Ip unit 4 modified on 22.06.21
Ip unit 3 modified of 26.06.2021
Ip unit 2 modified on 8.6.2021

Recently uploaded (20)

PPTX
additive manufacturing of ss316l using mig welding
PDF
PPT on Performance Review to get promotions
PDF
Structs to JSON How Go Powers REST APIs.pdf
DOCX
573137875-Attendance-Management-System-original
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Welding lecture in detail for understanding
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Geodesy 1.pptx...............................................
PPTX
web development for engineering and engineering
PDF
composite construction of structures.pdf
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Well-logging-methods_new................
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPT
Mechanical Engineering MATERIALS Selection
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
additive manufacturing of ss316l using mig welding
PPT on Performance Review to get promotions
Structs to JSON How Go Powers REST APIs.pdf
573137875-Attendance-Management-System-original
OOP with Java - Java Introduction (Basics)
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Welding lecture in detail for understanding
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Geodesy 1.pptx...............................................
web development for engineering and engineering
composite construction of structures.pdf
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Foundation to blockchain - A guide to Blockchain Tech
Well-logging-methods_new................
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Mechanical Engineering MATERIALS Selection
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Model Code of Practice - Construction Work - 21102022 .pdf
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx

Ip unit 5

  • 1. Image Processing (KCS-062): Unit-5: Image compression, Representation, Pattern classes and Matching Dr. Radhey Shyam Professor Department of Computer Science and Engineering BIET Lucknow (Affiliated to Dr. A.P.J. Abdul Kalam Technical University Unit-5 have been compiled/prepared by Dr. Radhey Shyam, with grateful acknowledgment who made their course contents freely available. Feel free to use this study material for your own academic purposes. For any query, the communication can be made through my mail shyam0058@gmail.com. Course Outcome of Unit-5, the students will be able to explain the basic concepts of Image compression,Representation, and Pattern classes and Matching. Date: July 17, 2021
  • 16. 01/12/2020 Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Representation & Description Representation & Description The results of segmentation is a set of regions. Regions are then represented (often univocally) and described (often non-univocally) Two main ways of representing a region: - external characteristics (its boundary): focus on shape and size - internal characteristics (its internal pixels): focus on color, textures… The next step: description E.g.: a region may be represented by its boundary, and its boundary described by some features such as length, regularity… - Features should be insensitive to translation, rotation, and scaling. - Both boundary and regional descriptors are often used together. Copyright notice: Most images in these slides are © Gonzalez and Woods, Digital Image Processing, Prentice-Hall Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Representation of boundaries Representation of boundaries Hypotheses: binary images, objects do not touch the image border (padding if necessary), one object at a time To represent a boundary, it is useful to compact the raw data (list of boundary pixels coordinates)  Boundary following: start at the first boundary position in (e.g.) lexicographic ordering and build a chain code Chain codes: list of segments with defined length and direction • 4-directional chain codes • 8-directional chain codes - At each boundary pixel, circularly inspect the neighbourhood until a new boundary pixel is found - Stop when contour closes Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Representation of boundaries Representation of boundaries Simplify It may be useful to downsample the border image before computing the chain code • to reduce the code size • to remove useless details along the boundary Can be conveniently done during the boundary following process: at each step the large-grid node is selected which is closest to a boundary point Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Representation of boundaries Representation of boundaries • To make the code independent of the starting point: the code is a circular sequence; the starting point is defined as the one which yields a sequence of numbers that together represent the smallest possible integer E.g., 10103322  01033221 • To normalize wrt rotation (in 90 deg. or 45 deg. steps): first differences (no. of direction changes) can be used E.g., 10103322  3133030 (counting ccw) and pre-pending the last transition (circular sequence: 2  1 = 3)  33133030 (shape number, see later)
  • 17. 01/12/2020 Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Representation of a shape Representation of a shape Skeletons represent (non-univocally) a shape by reducing it to a graph Medial axis transform (Blum 1967): points that have more than one closest boundary points. Also built using a prairie fire process • object is a field of dry grass • fire is simultaneously lit along the boundary • fire propagates at uniform velocity • skeleton is the set of quench points, where two independent fire-fronts meet Highly sensitive to small details Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Representation of a shape Representation of a shape Skeletons represent (non-univocally) a shape by reducing it to a graph Digital approaches can simulate the grassfire propagation using • iterative constrained erosion process • centers of maximal balls in distance-transform domain (together with their radii, they permit exact reconstruction of the object) • centers of the enclosed balls that touch the object boundary at two or more disjoint locations. Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Boundary descriptors Boundary descriptors Simple descriptors: • length e.g., for 8-connected chain code: horiz. components + vert. components + 21/2 diag. components • order no. ef elements in the code (same as above without 21/2 factor) • diameter length of the major axis: max(D(pi,pj)) where D is a distance and pi , pj are points on the boundary. The minor axis is orthogonal to the major axis, and has length [no matter its position] that permits to determine the • basic rectangle that minimally encloses the boundary • eccentricity of the basic rectangle (major/minor axes ratio) Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Boundary descriptors Boundary descriptors • shape number: first-difference code of smallest magnitude (treating the chain code as a circular sequence) All the shapes of order 4, 6, 8 The dot is the starting point
  • 18. 01/12/2020 Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Boundary descriptors Boundary descriptors Steps in the generation of a shape number It is advisable to normalize the grid orientation by aligning the chain code grid to the basic rectangle (note: poor drawing of the basic rectangle in this fig., or may indicate small set of available discrete orientations) Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Boundary descriptors Boundary descriptors • 1-D Fourier descriptors the sequence of boundary points is treated as a sequence of points in the complex plane - It becomes a complex 1-D descriptor - Can be DFT-transformed Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Boundary descriptors Boundary descriptors Different approximated descriptions are obtained by dropping some DFT coefficients Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Boundary descriptors Boundary descriptors
  • 19. 01/12/2020 Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Boundary descriptors Boundary descriptors Fourier descriptors are not insensitive to translation etc., but their effects on the transform coefficients are known: Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Boundary descriptors Boundary descriptors • Statistical moments A portion of a boundary can be described as a 1-D function (stopping when the distance from the origin stops growing) Then, statistical moments (mean, variance, skewness, kurtosis, …) can be used to describe it • Treat g(r) as a discrete r.v. v in the range [0, A-1] (quantized levels on the g(r) axis above), having a pdf p(vi) • Its n-th central moment is mn(v)=Si (vi-m)n p(vi) where m = Si vi p(vi) Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Regional descriptors Regional descriptors Some simple descriptors • area • compactness = perimeter2/area (dimensionless  insensitive to scale) - In this figure: (white area) / (total light area) gives an idea of relative electrical energy consumption (should be normalized by land/sea fraction in image, or by population density) Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Regional descriptors Regional descriptors Topology (maths) is the study of the region properties which are unaffected by rubber-sheet deformations (non-Euclidean geometry) [like in many subway maps] [http://www.rrb.wayne.edu/topology.html] • number of holes H • number of connected components C • Euler number, E = C - H
  • 20. 01/12/2020 Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Regional descriptors Regional descriptors Textures can be analyzed by statistical descriptors in terms of smoothness, coarseness, regularity … Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Regional descriptors: some statistical descriptors Regional descriptors: some statistical descriptors - Statistical (central) moments mn(z) = Si (zi-m)np(zi) of the gray-level histogram p(zi) - Activity index R R = 1 - 1/(1+s 2) (R=0 in flat areas,  1 in very active ones) - Uniformity U U = Si p2(zi) (max. if gray levels are equally distributed) - Entropy e e = - Si p(zi) log2 p(zi) (is 0 for a constant image) [R, U, and e provide approx. the same information] Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Regional descriptors Regional descriptors Moments of the image as a 2-D function Moment: mpq= SxSy xp yq f (x,y) Central moment: mpq= SxSy (x-x’)p (y-y’)q f(x,y) with x’= m10 / m00 and y’= m01 / m00 If we define the normalized central moments hpq = mpq / m00 g with g = (p+q)/2 + 1 seven invariant moments can be defined, e.g. f1 = h20h02 f2 = (h20-h02)2 + 4h11 2 … which are invariant to translation, rotation, scaling, and mirroring (but for a sign change) Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Regional descriptors Regional descriptors
  • 21. 01/12/2020 Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Regional descriptors Regional descriptors Fourier spectrum features: - amplitude of peaks gives principal directions of the patterns - location of maximum peak(s) gives the fundamental period(s) - periodic components can be removed via filtering; the remaining non-periodic image can be analyzed using statistical techniques The spectrum can be also studied in polar coordinates: S(r,q) For each pair r,q we can have two descriptors: S(r) = Sq Sq(r) S(q ) = Sr Sr(q ) see also: z11_Shape-based image retrieval using generic Fourier descriptor Matlab Central 2016: FD = gfd(bw,m,n) - Implementation of the Generic Fourier Descriptors Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Regional descriptors Regional descriptors Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Next step: use features for segmentation / classification Next step: use features for segmentation / classification Gianni Ramponi http://www.units.it/ramponi Digital Image Processing Next step: use features for segmentation / classification Next step: use features for segmentation / classification
  • 22. 01/12/2020 Gianni Ramponi http://www.units.it/ramponi Digital Image Processing …or use Deep Learning for segmentation / classification …or use Deep Learning for segmentation / classification Gianni Ramponi http://www.units.it/ramponi Digital Image Processing …or use Deep Learning for segmentation / classification …or use Deep Learning for segmentation / classification  Dip11a, b