Unit-3 Ip&cv
Unit-3 Ip&cv
Description
Image analysis fundamental steps
Representation and description
• After segmentation one needs to represent objects in order to describe them
• Internal (regional)
• Representation: Pixels inside the object
• Description: The average color
OR use both methods
Representation
The segmentation techniques yield raw data in the form of pixels along a
boundary or pixels contained in a region
It is standard practice to use schemes that compact the segmented data into
representations that facilitate the computation of descriptors
BOUNDARY FOLLOWING (TRACING)
We assume in this section that all curves are closed, simple curves (i.e., curves that are closed
and not self intersecting).
Freeman Chain Codes
The direction of each segment is coded by using a numbering scheme, as in Fig. 11.3
A boundary code formed as a sequence of such directional numbers is referred to as a
Freeman chain code.
Digital images usually are acquired and processed in a grid format with equal spacing in
the x- and y-directions, so a chain code could be generated by following a boundary in,
say, a clockwise direction and assigning a direction to the segments connecting every
pair of pixels
This level of detail generally is not used for two principal reasons:
(1) The resulting chain would be quite long and
(2) any small disturbances along the boundary due to noise or imperfect segmentation
would cause changes in the code that may not be related to the principal shape
features of the boundary
An approach used to address these problems is to resample the boundary by
selecting a larger grid spacing, as in Fig. 11.4(a).
For a closed curve, the approximation becomes exact when the number of
segments of the polygon is equal to the number of points in the boundary, so
each pair of adjacent points defines a segment of the polygon
The main advantage of this method is simplicity, but it has the disadvantage that scaling of the
entire function depends on only two values: the minimum and maximum
If the shapes are noisy, this can be a source of significant error from object to object
A more rugged (but also more computationally intensive) approach is to divide each sample by
the variance of the signature, assuming that the variance is not zero—as in the case of Fig.
11.10(a)—or so small that it creates computational difficulties
Using the variance yields a variable scaling factor that is inversely proportional to changes in size
and works much as automatic volume control does
Whatever the method used, the central idea is to remove dependency on size while preserving
the fundamental shape of the waveforms.
Distance versus angle is not the only way to generate a signature.
For example, another way is to traverse the boundary and, corresponding to each point on
the boundary, plot the angle between a line tangent to the boundary at that point and a
reference line
The resulting signature, although quite different from the r(u) curves in Fig. 11.10, carries
information about basic shape characteristics
For instance, horizontal segments in the curve correspond to straight lines along the
boundary because the tangent angle is constant there
A variation of this approach is to use the so-called slope density function as a signature
This function is a histogram of tangent-angle values. Because a histogram is a measure of
the concentration of values, the slope density function responds strongly to sections of the
boundary with constant tangent angles (straight or nearly straight segments) and has deep
valleys in sections producing rapidly varying angles (corners or other sharp inflections).
BOUNDARY FEATURE DESCRIPTORS
SOME BASIC BOUNDARY DESCRIPTORS
For a chain-coded curve with unit spacing in both directions, the number of vertical
and horizontal components plus 2 multiplied by the number of diagonal components
gives its exact length
If the boundary is represented by a polygonal curve, the length is equal to the sum
of the lengths of the polygonal segments
The diameter of a boundary B is defined as
The value of the diameter and the orientation of a line segment connecting the
two extreme points that comprise the diameter is called the major axis (or
longest chord) of the boundary
That is, if the major axis is defined by points (x1 , y1 ) and (x2 , y2 ), then the
length and orientation of the major axis are given by
The minor axis (also called the longest perpendicular chord) of a boundary is
defined as the line perpendicular to the major axis, and of such length that a
box passing through the outer four points of intersection of the boundary with
the two axes completely encloses the boundary.
The box just described is called the basic rectangle or bounding box, and the
ratio of the major to the minor axis is called the eccentricity of the boundary.
STATISTICAL MOMENTS
To see how this can be accomplished, consider Fig. 11.20 which shows the
signature from Fig. 11.10(b) sampled, and treated as an ordinary discrete
function g(r) of one variable, r.
11.10(b)
Suppose that we treat the amplitude of g as a discrete random variable z and
form an amplitude histogram p(zi), i = 0, 1, 2,…, A - 1, where A is the number
of discrete amplitude increments in which we divide the amplitude scale.
In this case, r is treated as the random variable and the moments are
REGION FEATURE DESCRIPTORS
When area and perimeter are used as descriptors, they generally make sense only when they
are normalized
A more frequent use of these two descriptors is in measuring compactness of a region, defined
as the perimeter squared over the area:
This is the diameter of a circle having the same area, A, as the region being
processed.
While no formal definition of texture exists, intuitively this descriptor provides measures of
properties such as smoothness, coarseness, and regularity (Fig. 11.29 shows some examples)
In this section, we discuss statistical approaches for describing the texture of a region
SIFT is an algorithm developed by Lowe [2004] for extracting invariant features from an image
It is called a transform because it transforms image data into scale-invariant coordinates relative
to local image features
When images are similar in nature (same scale, similar orientation, etc), corner detection and
MSERs are suitable as whole image features
However, in the presence of variables such as scale changes, rotation, changes in illumination,
and changes in viewpoint, we are forced to use methods like SIFT
SIFT features (called keypoints) are invariant to image scale and rotation, and are robust across
a range of affine distortions, changes in 3-D viewpoint, noise, and changes of illumination
The input to SIFT is an image. Its output is an n-dimensional feature vector whose elements are
the invariant feature descriptors
The algorithm
SIFT is quite an involved algorithm. There are mainly four steps involved in the SIFT
algorithm
•Keypoint Matching
Fig 01: Sequence of steps followed in SIFT Detector