You are on page 1of 27

Computer Vision

CSC-455
Today’s Lecture

• More Image Feature


Extraction
• Recognition (Classification)
• k-NN Classification
• Classifier Performance
• Decision Trees
• Audio & Speech Recognition
Classification system

Feature Extractor
Camera (Image Processing) Classifier
Image Analysis

Typical steps:
• Pre-processing
• Segmentation (object
detection)
• Feature extraction
• Feature selection
• Classifier training
• Evaluation of classifier
performance.
Feature types (regional features)

• Colour features
• Gray level
features
• Shape features
• Histogram
(texture) features
Techniques for Image Features
Extraction
• Hough Transform
• Corners
• Shape features
• GLCM
• HOG
• SIFT
• SURF
• Gabor and Wavelet
• LBP
Techniques for Image Features
Extraction
• Hough Transform
• Corners
• Shape features
• GLCM
• HOG
• SIFT
• SURF
• Gabor and Wavelet
• LBP
Properties of Shape Features

•Identifiability: perceptually similar objects have


similar (or the same) features.
•Translation, rotation and scale invariance: the
location, the rotation and the scaling changing of the
shape must not affect the extracted features.
1. Center of Gravity
• The center of gravity is also called centroid. Its
position should be fixed in relation to the shape.
2. Circularity ratio
• Circularity ratio represents how a shape
is similar to a circle.
• Circularity ratio is the ratio of the area
of a shape to the shape's perimeter
square:
3. Rectangularity
• Rectangularity represents how rectangular a
shape is, i.e. how much it fills its minimum
bounding rectangle:

• where AS is the area of a shape; AR is the


area of the minimum bounding rectangle.
4. Convexity
• Convexity is defined as the ratio of
perimeters of the convex hull over that of
the original contour.
1

3
5. Solidity
• Solidity describes the extent to which the
shape is convex or concave.

• where, As is the area of the shape region and


H is the convex hull area of the shape. The
solidity of a convex shape is always 1.

14
6. Euler number
• Euler number describes the relation between
the number of contiguous parts and the
number of holes on a shape. Let S be the
number of contiguous parts and N be the
number of holes on a shape. Then the Euler
number is:
Texture Analysis: GLCM Features
Computation of Co-occurrence Matrix
- It has size N×N (N = Number of gray-values) i.e., the
rows & columns represent the set of possible pixel
values.

- It is computed based on two parameters:

d  Relative distance between the pixel pair


(measured in pixel number. e.g., 1, 2, …)
θ  Relative orientation / rotational angle.
(e.g., 0º, 45º, 90º, 135º, …)
8 Directions/orientations (θ) of Adjacency

In this thesis, we consider θas horizontal , front diagonal ,


 

vertical and back diagonal


Computation of Co-occurrence Matrix

Image matrix Find the number of co-occurrences of


0 0 1 1 pixel i to the neighboring pixel value j
0 0 1 1 i/j 0 1 2 3

0 2 2 2 0 #(0,0) #(0,1) #(0,2) #(0,3)


2 2 3 3
1 #(1,0) #(1,1) #(1,2) #(1,3)
 Pixel values: 0,1,2,3. So,N= 4
2 #(2,0) #(2,1) #(2,2) #(2,3)
So, size of CM = 4x4
3 #(3,0) #(3,1) #(3,2) #(3,3)
d=1
θ = horizontal
  d=1 θ = horizontal
i/j 0

0 #(0,0)

0 0 1 1 2
0 0 1 1
0 2 2 2
2 2 3 3
Example: Computation (contd.)

0 0 1 1 2 2 1 0
0 0 1 1
Image
0 2 2 2
2 2 3 3
i/j 0 1 2 3 CM for the Image

0 #(0,1) #(0,2) #(0,3)  d=1 θ = horizontal

3
Example: Computation (contd.)

0 0 1 1 2 2 1 0
0 0 1 1 0 2 0 0
Image 0 0 3 1
0 2 2 2
2 2 3 3 0 0 0 1
i/j 0 1 2 3
CM for the Image

0 #(0,0) #(0,1) #(0,2)  


#(0,3) d=1 θ = horizontal

1 #(1,0) #(1,1) #(1,2) #(1,3)

2 #(2,0) #(2,1) #(2,2) #(2,3)

3 #(3,0) #(3,1) #(3,2) #(3,3)


Example: Computation (contd.)

0 0 1 1 3 0 2 0
0 0 1 1 0 2 2 0
Image 0 0 1 2
0 2 2 2
2 2 3 3 0 0 0 0
i/j 0 1 2 3
CM for the Image

0 #(0,0) #(0,1) #(0,2) #(0,3)


  d=1 θ = vertical
1 #(1,0) #(1,1) #(1,2) #(1,3)

2 #(2,0) #(2,1) #(2,2) #(2,3)

3 #(3,0) #(3,1) #(3,2) #(3,3)


Features on co-occurrence matrix
- Co-occurrence matrices capture properties of a texture
- But they are not directly useful for further analysis
(e.g., comparison of two textures)

11 Numeric features are computed from a matrix


Features on co-occurrence matrix (contd.)

Co-occurrence Matrices
 
(d,θ) = (1,)
Angular Second Moment (ASM) feature
Input image Contrast feature Feature
Entropy feature Vector
  Variance feature
(d,θ) = (1,)
Correlation feature
Inverse Difference Moment (IDM) feature
Sum Average feature
  Sum Variance feature
(d,θ) = (1,) Sum Entropy feature
Information Measures of Correlation feature – 1
Information Measures of Correlation feature – 2
 
(d,θ) =(1,)
ENERGY
• Also called Uniformity or Angular second moment.
• Measures the textural uniformity that is pixel pair
repetitions.
• Detects disorders in textures.
• Energy reaches a maximum value equal to one.

2
 
𝐸𝑛𝑒𝑟𝑔𝑦 =∑ ∑ 𝑝 𝑖𝑗
𝑖 𝑗
 
Entropy

• Measures the disorder or complexity of an


image.
• The entropy is large when the image is not
texturally uniform.
• Complex textures tend to have high entropy.
• Entropy is strongly, but inversely correlated
to energy.


 
Contrast
• Measures the spatial frequency of an image
and is difference moment of GLCM.
• It is the difference between the highest and the
lowest values of a contiguous set of pixels.
• It measures the amount of local variations
present in the image.

• Contrast(con)=

You might also like