Module 3-Part 1
Module 3-Part 1
PART-I
After an image has been segmented into regions, it is usually represented and
described in a form suitable for further computer processing.
Representing a region involves 2 choices - We can represent the region in terms of its
(i) external characteristics (boundary).
(ii) internal characteristics (the pixels comprising the region).
An external representation is chosen when the primary focus is on shape
characteristics.
An internal representation is chosen when the primary focus is on region properties
like color & texture.
After representation, next we describe the region based on the chosen representation.
Representation Approaches:
Boundary Representation
1. Boundary (Border) Following
Most of the algorithms require that the points in the boundary of a region be
ordered in a clockwise or anti clockwise direction.
Hence we go for a boundary algorithm whose output is an ordered sequence of
points.
Also known as Moore boundary tracking.
Assume a binary image in which object & background points are labelled 1 & 0
respectively.
Given a binary region R or its boundary, an algorithm for following the border of
R is given as follows:
1.
Letthe starting point be the uppermost left most point in the image that is
labelled 1. Denote as the west neighbor of . Clearly is always a background
point. Examine the 8 neighbors of , starting at and proceeding in a clockwise
direction. Let denote the first neighbor encountered whose value is 1 and let be
the (background) point immediately preceding in the sequence. Store the
locations of & for use in step 5.
2. Let b = and c = .
3. Let the 8 neighbors of b, starting at c and proceeding in a clockwise direction be
denoted by Find the first labelled 1.
4. Let b = and c =
5. Repeat steps 3 & 4 until b = and the next boundary point found is The sequence
of b points found when the algorithm stops constitute the set of ordered boundary
points.
𝒄 𝟏
𝒃𝟏 ,
Set of ordered
Boundary Points
2. Chain Codes
There
are several methods to describe the boundary of a region.
1. Some Simple Descriptors
Length : The length of a boundary is one of the simplest descriptors. The number of
pixels along a boundary gives a rough approximation of its length.
Diameter : The diameter of a boundary B is defines as
, where D is a distance measure and are points
on the boundary.
Major Axis : The largest diameter is the major axis.
Minor Axis : The minor axis of a boundary is defined as the line perpendicular to the
major axis.
Basic Rectangle : The box consisting of major & minor axes with points
intersecting the border forms a basic rectangle.
Eccentricity : The ratio of the major to the minor axis is called eccentricity of the
boundary and is also a useful descriptor.
Curvature defined as the rate of change of slope of boundary segments is another
descriptor.
2. Shape Numbers
The first difference of a chain coded boundary depends on the starting point.
First differences are computed by treating the chain as a circular sequence.
The shape number of such a boundary, based on the 4 directional code is defined as the
first difference of smallest magnitude.
The order n of a shape number is defined as the number of digits in its representation.
n is even for a closed boundary.
Eg: All closed shapes of order n=4, 6 and 8 are shown in figure.
Generation of Shape Number
Consider
a K-point digital boundary in the x-y plane.
Starting at an arbitarary point traversing the boundary in the counter clockwise
direction, we encounter the co-ordinates , ,….. .
The boundary can be represented as a sequence of co-ordinates , k=0,1,…K-1.
s(k) can be represented as a complex number and the DFT is computed.
𝐾 −1 𝑗2 𝜋 𝑢
− 𝑘
𝐾
𝑎 ( 𝑢 ) = ∑ 𝑠(𝑘)𝑒 , 𝑢=𝑜 , 1 , … . 𝐾 −1
𝑘 =0
The complex coefficients a(u) are called the Fourier descriptors of the boundary
The inverse Fourier transform of these coefficients restores s(k).
𝐾 −1 𝑗 2 𝜋 𝑢𝑘
1 𝐾
𝑠 (𝑘 )= ∑ 𝑎 (𝑢)𝑒 , 𝑘=𝑜 , 1 ,… . 𝐾 −1
𝐾 𝑢 =0
The table summarizes the Fourier descriptors for a boundary sequence s(k) that
undergoes rotation, translation, scaling & changes in starting point.
4. Statistical Moments
The
shape of boundary segments can be described using statistical moments like mean,
variance & higher order moments.
A boundary segment may be represented as a 1D function g(r) by connecting the end
points and rotating the line segment to be horizontal.
We can treat the amplitude of g as a discrete random variable ‘v’ representing discrete
amplitude in the range [0, A-1] then the statistical moment of v (about its mean) is
calculated as:
An
alternative approach is to normalize g(r) to unit area and represent it as a
histogram.
Now g() is the probability of value .
Here r is treated as the random variable and moments are given by
Regional Descriptors
1.
Some Simple Descriptors
Area of the region - number of pixels in the region.
Perimeter of region - length of its boundary
Compactness -
Circularity Ratio – Ratio of area of the region to the area of a circle having the same
perimeter.
Other regional descriptors include statistics on the intensity levels of the pixels in the
region
– Mean & median of the intensity values
– Minimum & Maximum intensity value
– Number of pixels with values above or below the mean
2. Topological Descriptors
Texture
provides measure of properties such as smoothness, coarseness & regularity.
3 principal approaches used to describe texture of a region - statistical, structural &
spectral.
a) Statistical Approaches: 2 types: Histogram approach & co-occurrence matrix.
Simplest method for describing texture is to use statistical moments of the intensity
histogram of an image or region.
Let z be a random variable denoting intensity and , i=0,1,2…L-1 be the
corresponding histogram, where L is the number of distinct intensity levels. The nth
moment of z about mean is given by
The
second moment or variance is a measure of intensity contrast used to
establish descriptors of relative smoothness.
Eg: the measure is 0 for areas of constant intensity (variance is 0) and approaches
1 for larger values of .
The third moment is a measure of skewness of the histogram while the fourth
moment is a measure of its relative flatness.
Some additional texture measures based on histograms include measure of
uniformity given by
, (maximum for uniform images)
And average entropy E. Entropy is a measure of variability and is 0 for a constant
image.
Measure
of texture computed using only the histogram carries no information
regarding the relative position of pixels wrt each other.
Let Q be an operator that defines the position of two pixels relative to each other.
Consider an image f, with L possible gray levels.
Let G be a matrix whose element is the number of times that pixel pairs with
intensities and occur in f in the position specified by Q.
G is called co-occurrence matrix.
Figure shows an example how to construct a co-occurrence matrix with L=8 &
position operator Q defined as one pixel immediately to the right.
Since G depends on Q, the presence of intensity texture patterns can be detected
by choosing an appropriate position operator and analyzing the elements of G.
Eg: the element (1,1) of G is 1, because there is only 1 occurrence in f of a pixel value 1
having a pixel valued 1 immediately to its right.
The element (6,2) of G is 3, because there are 3 occurrences in f of a pixel value 6
having a pixel valued 2 immediately to its right.
A set of useful
descriptors for analyzing
the elements of G are
listed
b) Structural Approaches:
Suppose
we have a rule , which indicates that the symbol ‘S’ can be rewritten as ‘aS’.
Three repetitions of the rule yield the string aaaS.
If ‘a’ represents a circle and the meaning “circles to the right” is assigned to a
string of the form ‘aaa…’ then the rule allows the generation of the pattern:
The
Fourier transform (FT) is a useful for description of the directionality of periodic
or almost periodic structures.
The 3 features of the Fourier Spectrum that are useful for texture description are:
1. Peaks in the FT give the principal direction of patterns.
2. The location of peaks gives the fundamental period of patterns.
3. The FT is symmetric around the origin and only half of the frequency plane needs
to be considered.
The spectrum is expressed in polar coordinates S(r,θ) for simplification
(θ) is a 1D function for a given direction (r) and (r) is a 1D function for a given
direction (θ).
Analyzing
(r) for a fixed value of θ yields the behavior of the spectrum along a
radial direction from the origin.
Analyzing (θ) for a fixed value of r yields the behavior of the spectrum along a
circle of radius r which is centered at the origin.
A more global description is obtained by integrating these functions:
Applies
to both boundary and regions.
Example: the staircase structure has been extracted from an image and we want to
describe it.
We employ two primitive elements ‘a’ & ‘b’ and a set of rules.
One simple approach is to use a recursive relationship involving these variables.
1.
THANK YOU!