Unit-IV CC
Unit-IV CC
Unit IV
𝐿−1
𝑀𝑒𝑎𝑛(𝑏)= 𝑏=0 𝑏. 𝑝(𝑏)
2
SD = 𝜎𝑏 = 𝐿−1
𝑏=0[ 𝑏 − 𝑏 𝑝 𝑏 ]1/2
Skewness
1 𝐿−1
Skewness = 𝑏=0(𝑏 − 𝑏)3 𝑝(𝑏)
𝜎𝑏3
Kurtosis
Kurtosis is a measure of the "tailedness" of the intensity
distribution.
High kurtosis indicates a sharper peak and heavier tails, while low
kurtosis indicates a flatter peak and lighter tails
1 𝐿−1 4
Kurtosis = 𝑏=0 𝑏−𝑏 𝑝 𝑏 −3
𝜎𝑏4
Energy
Energy is the sum of brightness values of all the pixels present in
the object. This is called zero order spatial moment
𝐿−1
Energy = 𝑏=0[𝑝 𝑏 ]2
𝐿−1
Entropy = - 𝑏=0 𝑝 𝑏 . 𝑙𝑜𝑔2 𝑝(𝑏)
Second Order Moments / Texture Analysis
• These are based on joint probability distribution of pixels I and J.
The histogram of histogram of the second order distribution is
given by
𝑁(𝑎,𝑏)
p(a,b) ≈
𝑚
1. Colour histogram
2. Histogram Intersection
3. Colour Coherence Vector
Colour histogram
• Let two histograms of images A nd B, be given as follows:
𝑘
d= 𝑗=1 𝑗𝐴 − 𝑗𝐵
Histogram Intersection
• The pixels that are common in two images, is given by
𝑘 𝐴
I 𝐻 (𝐴) , 𝐻 (𝐵) = 𝑗=1 min(𝑗 − 𝑗𝐵 )
Colour Coherence Vector
For finding colour coherence vector, the image can be
partitioned into two parts – one part consisting of a count of
pixels that belong to a large uniform region and the other
consisting of the pixels that belong to a sparse region.
Where,
P is the coherent pixel
Q is the incoherent pixel
Note:
• Similar to non-colour images, the mean, the variance, skewness,
kurtosis and other moments can be identified and detected for
feature extraction from colour images
• These image features are mostly used with content-based
retrieval systems.
Shape features
Shape Feature
• Shape features in image processing are descriptors that capture
the geometric properties and spatial arrangement of objects or
regions within an image
• These features provide valuable information about the shape,
size, orientation, and compactness of objects, and they are
widely used in tasks such as object recognition, classification,
segmentation, and tracking.
Shape region features are
1. Area
2. Perimeter
3. Shape factor (Compactness)
4. Area to Perimeter ration
5. Object Length
6. Object width
7. Elongatedness
8. Aspect Ratio
9. Rectangularity
Area
The area of an object is the number of pixels in the object. It is
shift invariant. The area of binary image is given by
𝑛 𝑚
A= 𝑖=1 𝑗=1 𝐵(𝑖, 𝑗)
𝑁𝐵
A(Q) = 𝑁1 + −1
2
where,
NB is the number of points that lie in boundary
N1 is the number of interior points, not in boundary
Perimeter
• Perimeter of an object is the number of pixels present in the
boundary of the object.
• Perimeter is shift invariant and rotation invariant.
Compactness (Shape Factor)
• It’s a measure of how closely an object's shape resembles a
compact form
𝑃𝑒𝑟𝑖𝑚𝑒𝑡𝑒𝑟 2 𝑃2
Compactness = or
𝐴𝑟𝑒𝑎 𝐴
Circularity (Area to Perimeter ratio)
• A measure of how closely an object's shape resembles a circle
4𝜋𝐴
Circularity =
𝑃𝑒𝑟𝑖𝑚𝑒𝑡𝑒𝑟 2
Object Length (major axis)
The longest line that can be drawn through the object
connecting the two farthest points in the boundary is called its
major axis. If 𝑥1 , 𝑦1 𝑎𝑛𝑑 𝑥2 , 𝑦2 are end points of major axis,
then major axis length is given by
𝑥2 − 𝑥1 2 + 𝑦2 − 𝑦1 2
Object Width (minor axis)
It is the largest line that can be drawn through the object
while maintaining perpendicular with the major axis. The formula
is
𝑥2 − 𝑥1 2 + 𝑦2 − 𝑦1 2
𝑅𝑒𝑔𝑖𝑜𝑛 𝐴𝑟𝑒𝑎
𝑅𝑒𝑐𝑡𝑎𝑛𝑔𝑢𝑙𝑎𝑟𝑖𝑡𝑦 =
𝐴𝑟𝑒𝑎 𝑜𝑓 𝑚𝑖𝑛𝑖𝑚𝑢𝑚 𝑏𝑜𝑢𝑛𝑑𝑖𝑛𝑔 𝑟𝑒𝑐𝑡𝑎𝑛𝑔𝑙𝑒
Local Binary Patterns (LBP)
• Local Binary Patterns (LBP) have emerged as a
powerful technique for texture description and feature
extraction.
• First introduced by Ojala, Pietikäinen, and Maenpaa in
1994, LBP has found widespread use in various
applications such as facial recognition, texture
classification, and object detection due to its simplicity
and effectiveness.
What are Local Binary Patterns?
• LBP is a texture descriptor that characterizes the
local structure and appearance of an image. It
operates by analyzing the relationship between a
pixel and its neighboring pixels within a defined
neighborhood. This process enables the encoding
of texture information by comparing pixel
intensities.
What are Local Binary Patterns?-Cont.
• The fundamental idea behind LBP revolves around
thresholding. To compute the LBP value of a pixel, a
threshold is applied to the intensity values of its surrounding
pixels.
• The resulting binary pattern is constructed by comparing the
intensity of each neighbor with the center pixel. If the
neighbor's intensity is greater than or equal to that of the
center pixel, it is assigned a value of 1; otherwise, it receives
a value of 0.
• This sequence of binary values is then converted to a decimal
number, creating the LBP code for that pixel.
LBP Work Process
• Selecting a Neighborhood: A key aspect of LBP
is the choice of neighborhood for each pixel.
Typically, a square neighborhood of a certain
radius is considered, encompassing a set of
neighboring pixels around the central pixel.
LBP Work Process
• Thresholding and Binary Comparison: Once
the neighborhood is defined, the LBP operator
computes the binary pattern. It compares the
grayscale intensity of the center pixel with that of
its neighbors, setting the bit to 1 if the neighbor's
intensity is greater than or equal to the center
pixel's intensity; otherwise, it assigns a 0.
LBP Work Process
•Building the LBP Code: After
performing the comparisons for all the
neighbors, the resulting binary sequence
is assembled clockwise or
counterclockwise to form the LBP code.
LBP Work Process
•Histogram Generation: The LBP codes
are then used to construct a histogram,
where the frequency of occurrence of
different LBP patterns within the image
is recorded. This histogram serves as a
feature vector representing the texture
characteristics of the image.
Algorithm to Calculate Local Binary Pattern
• Steps:
• 1- Divide the examined window into cells (e.g. 16x16 pixels for each
cell).
• 2- For each pixel in a cell, compare the pixel to each of its 8 neighbors
(on its left-top, left-middle, left-bottom, right-top, etc.). Follow the
pixels along a circle, i.e. clockwise or counter-clockwise.
• 3- Where the center pixel's value is greater than the neighbor's value,
write "1". Otherwise, write "0". This gives an 8-digit binary number
(which is usually converted to decimal for convenience).
• 4- Compute the histogram, over the cell, of the frequency of each
"number" occurring (i.e.,each combination of which pixels are smaller
and which are greater than the center)
• 5-Optionally normalize the histogram.
• 6- Concatenate (normalized) histograms of all cells. This gives the
feature vector for the window.
• Formula/Expression:
Applications of LBP
• Types of Compression
• Two broad categories
• 1. Lossless algorithms.
• 2. Lossy algorithms.
Variable Length Coding –Bit – Plane Coding Lossless
Predictive Coding – Lossy Compression – Lossy
Predictive Coding.
Introduction and Overview
1. Internet,
2. Businesses,
3. Multimedia,
4. Satellite imaging,
5. Medical imaging
1. Data:
• For digital images, data refers to the pixel gray
level values that correspond to the brightness
of a pixel at a point in space
• Data are used to convey information, much like
the way the alphabet is used to convey
information via words