Software and Systems Engineering Standards: Verification and Validation of Sy...
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
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