Professional Documents
Culture Documents
IT5409 - Ch4 - Part2 - Feature ExtractionMatching - 4pages
IT5409 - Ch4 - Part2 - Feature ExtractionMatching - 4pages
Plan
• Edges
‒ Detection
‒ linking
1 2
3 4
22/05/2021
5 6
• Histogram intersection
∑ min( ℎ , 𝑔 )
∩ (H,G) =
∑ 𝑔
7 8
22/05/2021
9 10
I2
11 12
22/05/2021
‒ Co-occurence matrices
• Searching patterns
‒ Frequential analysis
• Gabor filter
‒…
• The most difficult is to find a good representation (good
parameters) for each texture
13 14
is.hust.edu.vn 15 16
22/05/2021
GLCM GLCM
Example on how to compute these matrices: Example on how to compute these matrices:
1 2 3 4 1 2 3 4
1 4 4 3 1 4 4 3
1 ? ? ? ? 1 0 0 0 1
4 2 3 2 4 2 3 2
2 ? ? ? ? 2 0 0 0 0
1 2 1 4 1 2 1 4
3 ? ? ? ? 3 0 0 0 0
1 2 2 3 1 2 2 3
4 ? ? ? ? 4 0 0 0 0
Image Image
Matrix for distance=1 Matrix for distance=1 and
and direction=0° direction=0°
We loop over the image and for each pair of pixels following the given Pair of neighbor pixels (1,4)
distance and orientation, we increment the co-occurence matrix
22/05/2021
GLCM GLCM
Example on how to compute these matrices: Example on how to compute these matrices:
1 2 3 4
1 2 3 4 1 4 4 3
1 4 4 3 1 0 0 0 1
1 0 0 0 1 4 2 3 2
4 2 3 2 2 0 0 1 0
2 0 0 0 0 1 2 1 4
1 2 1 4 3 0 1 0 0
3 0 0 0 0 1 2 2 3
1 2 2 3 4 0 1 1 1
4 0 0 0 1 Image
Image Matrix for distance=1 and
Matrix for distance=1 and direction=0°
direction=0°
GLCM GLCM
Example on how to compute these matrices • Most important/populer parameters computed from
(final): GLCM:
1 4 4 3
1 2 3 4 1 2 3 4
Energy CM d 2 (i, j ) minimal when all elements are equal
1 0 2 0 2 1 0 2 1 0
4 2 3 2 i j
2 1 1 2 0 2 1 1 0 0
1 2 1 4 entropy CM d (i, j ) log(CM d (i, j ))
3 0 1 0 0 3 0 0 0 1 a measure of chaos,
1 2 2 3 i j maximal when all elements are equal
4 0 1 1 1 4 0 2 1 0
Image
Matrix for distance=1 Matrix for distance=1 contrast (i j ) 2 CM d (i, j )
and direction=0° and direction=45° i j small values when big elements
1 are near the main diagonal
idm CM d (i, j )
i j 1 (i j ) 2
…and so on for each matrix (several matrices at the end) idm (inverse differential moment) has small values
when big elements are far from the main diagonal
is.hust.edu.vn 24
22/05/2021
GLCM Invariances
• Haralick features: • Rotation?
‒ For each GLCM, we can compute up to 14 (13) ‒ Average on all directions
parameters characterizing the texture, of which the most
important : mean, variance, energy, inertia, entropy,
• Scaling?
inverse differential moment
‒ Multi-resolutions
‒ Ref: http://haralick.org/journals/TexturalFeatures.pdf
is.hust.edu.vn 25 26
Source : William Robson Schwartz et al. Evaluation of Feature Descriptors for Texture Classification – 2012 JEI
27 28
22/05/2021
Boundary-based methods
Region-based methods
Gometrical Signatures
Global
Perimeter Centroid Distance Geometrical
Eccentricity Complex Coordinates Moment invariants
Curvature Curvature signature Area Zernike moments
Axes directionality Turning Angle Compactness Pseudo Zernike moments
Euler number
Grid method
Others Signature descriptors Decompasition
Chain codes Fourier Descriptors
Triangulation
UNL-Fourier
Medial Axis Transform
NFD
(Skeleton Transform)
Wavelet Descriptors
B-Splines
29 30
𝑀 , ,𝑀 , = 𝑐𝑒𝑛𝑡𝑟𝑜𝑖𝑑 𝑜𝑓 𝐷
• Central moments:
Invariant to
translation
31 32
22/05/2021
invariant to
translation,
scale, and
rotation, and
reflection
Change for
image
reflection
https://www.learnopencv.com/wp-content/uploads/2018/12/HuMoments-Shape-Matching.png
33 34
PHOG:
Pyramid Histogram of Oriented Gradients
https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/shape/sc_digits.html
Source:http://www.robots.ox.ac.uk/~vgg/research/caltech/phog.html
35 36
22/05/2021
Feature extraction
• Global features
• Local features
• Interest point detector
• Local descriptor
Source: CS131 - Juan Carlos Niebles and Ranjay Krishna
37 38
by swashford
by Diva Sian
NASA Mars Rover images
39 40
22/05/2021
Answer Below (Look for tiny colored squares) Motivation for using local features
• Global representations have major limitations
• Instead, describe and match only local regions
• Increased robustness to
‒ Occlusions
‒ Articulation d dq
φ
φ
θq
NASA Mars Rover images with SIFT feature matches
θ
(Figure by Noah Snavely)
41 42
D. Lowe 2002
A1 2. Define a region
around each keypoint
A2 A3
3. Extract and
normalize the region content
47 48
22/05/2021
• Solution:
• Describing local regions
• Adding spatial constraints if need Without knowledge about
image content
Based on the content of image
49 50
No chance to match!
We need a repeatable detector!
• Problem 2:
‒ For each point correctly recognize the corresponding one
51 52
22/05/2021
53 54
55 56
22/05/2021
Feature extraction
• Global features
• Local features
• Interest point detector
• Local descriptor Yarbus eye tracking
• Matching
Source : Derek Hoiem, Computer Vision, University of Illinois.
57 58
59 60
22/05/2021
61 62
Small
Nothing
Small
“flat” region: “edge”: “corner”:
no change in no change along significant change
all directions the edge in all directions
direction
Slide credit: Alyosha Efros
63 64
22/05/2021
E (u , v ) w( x, y ) I ( x u, y v ) I ( x, y )
2
E (u , v ) w( x, y ) I ( x u, y v ) I ( x, y )
2
x, y
x, y
Window Shifted
I(x, y)
Intensity E(u, v)
function intensity
or
Window function w(x,y) = E(0,0)
E (u , v ) w( x, y ) I ( x u, y v ) I ( x, y ) E (u , v ) w( x, y ) I ( x u, y v ) I ( x, y )
2 2
x, y x, y
x, y
second-order Taylor expansion:
We want to discover how E behaves for small shifts E (0,0) 1 E (0,0) Euv (0,0) u
E (u , v) E (0,0) [u v] u [u v] uu
Ev (0,0) 2 Euv (0,0) Evv (0,0) v
But we know the response in E that we are looking
for – strong peak. Approximation Notation: partial derivative
69 70
73 74
Image I Ix Iy IxIy
M
Slide credit: Rick Szeliski
Slide credit: David Jacobs
75 76
22/05/2021
(max)-1/2
• What if we have a corner that is not aligned with the (min)-1/2
image axes?
Slide credit: David Jacobs adapted from Darya Frolova, Denis Simakov
77 78
• Fast approximation
1 and 2 are small; ‒ Avoid computing the “Flat”
E is almost constant in “Edge”
all directions
“Flat” “Edge” eigenvalues region θ<0
region 1 >> 2
‒ α: constant 1
1
(0.04 to 0.06)
Slide credit: Kristen Grauman Slide credit: Kristen Grauman
79 80
22/05/2021
I 2
IxI y q det[M ( I , D )] a[trace(M ( I , D ))]2
M g ( ) x
g ( I x2 ) g ( I y2 ) [ g ( I x I y )]2 a[ g ( I x2 ) g ( I y2 )]2
Gaussian I x I y I y2
R
‒ Result is rotation invariant 5. Perform non-maximum suppression
C.Harris and M.Stephens. “A Combined Corner and Edge Detector.” Proceedings of the 4th Alvey
Vision Conference: pages 147—151, 1988.
Slide credit: Bastian Leibe Slide credit: Krystian Mikolajczyk
81 82
Slide adapted from Darya Frolova, Denis Simakov Slide adapted from Darya Frolova, Denis Simakov
83 84
22/05/2021
89 90
91 92
22/05/2021
Slide adapted from T. Tuytelaars ECCV 2006 tutorial Slide adapted from T. Tuytelaars ECCV 2006 tutorial
93 94
Same operator responses if the patch contains the same image up to scale
factor.
K. Grauman, B. Leibe K. Grauman, B. Leibe
f ( I i1 im ( x, )) f ( I i1im ( x, ))
97
98
Example Example
Function responses for increasing scale (scale signature) Function responses for increasing scale (scale signature)
Example Example
Function responses for increasing scale (scale signature) Function responses for increasing scale (scale signature)
103 104
22/05/2021
characteristic scale
T. Lindeberg (1998). "Feature detection with automatic scale selection." IJCV 30 (2): pp 77--116.
Source: K. Grauman, B. Leibe
Source: Lana Lazebnik
105 106
Lxx ( ) Lyy ( ) 3
2
List of
(x, y, σ)
- =
Ruye Wang
Source: K. Grauman, B. Leibe
111 112
22/05/2021
Laplacian
Find maxima
Find local maximum of:
…
…
‒ Harris corner detector in space y
(image coordinates)
k 2k Harris x
‒ Laplacian in scale
- =
- k List of
= (x, y, s)
- =
Input image 1 K.Mikolajczyk, C.Schmid. “Indexing Based on Scale Invariant Interest Points”. ICCV 2001
2 D.Lowe. “Distinctive Image Features from Scale-Invariant Keypoints”. IJCV 2004
113 114
115
1 K.Mikolajczyk, C.Schmid. “Indexing Based on Scale Invariant Interest Points”. ICCV 2001
2 D.Lowe. “Distinctive Image Features from Scale-Invariant Keypoints”. IJCV 2004
116
22/05/2021
D k 2
G k 2 * I
G k * I
D G k G * I Dk
G * I
D
117 118
119 120
22/05/2021
Source: Distinctive Image Features from Scale-Invariant Keypoints – IJCV 2004 Slide credit: CS131 -Juan Carlos Niebles and Ranjay Krishna
121
•
•
MSER
Salient Regions
[Matas ‘02]
123 124
22/05/2021
Following slides credit: CVPR 2003 Tutorial on Recognition and Matching Based on Local Invariant Features David Lowe
125 126
128
129 130
131 132
Steve Seitz
Steve Seitz
133 134
136
Feature stability to noise Feature stability to affine change
• Match features after random change in image scale & orientation, • Match features after random change in image scale & orientation,
with differing levels of image noise with 2% image noise, and affine distortion
• Find nearest neighbor in database of 30,000 features • Find nearest neighbor in database of 30,000 features
David G. Lowe, "Distinctive image features from scale-invariant keypoints," IJCV, 60, 2 (2004), pp. 91-110
135
22/05/2021
Feature extraction
ptors.pdf
• Global features
• Local features
• Interest point detector
• Local descriptor
• Matching
139 140
22/05/2021
2. Test all the features in I2, find the one with min distance ‒ Better approaches: add additional constraints
• Radio of distance
OpenCV: • Spatial constraints between neigborhood pixels
- Brute force matching
• Fitting the transformation, then refine the matches (RANSAC)
- Flann Matching: Fast Library for Approximate Nearest Neighbors
[Muja and Lowe, 2009]
Marius Muja and David G Lowe. Fast approximate nearest neighbors with automatic algorithm configuration. In VISAPP (1),
pages 331–340, 2009
141
I1 I2
I1 I2
22/05/2021
145
Ratio of distances reliable for matching Feature matching
• Better approaches: Spatial constraints between neigborhood pixels
David G. Lowe, "Distinctive image features from scale-invariant keypoints," IJCV, 60, 2 (2004), pp. 91-110 Source: from slides of Valérie Gouet-Brunet
148
22/05/2021
149
150
f d (r , r '
*
)
f ij min( wi , w j )
d EMD ( I1 , I 2 ) i j
ij i j
f
i j i j *
ij
i j
153 154
155 156
22/05/2021
Lowe 2002
Rothganger et al. 2003
http://www.cs.ubc.ca/~mbrown/autostitch/autostitch.html
161 162
Source. http://www-rocq.inria.fr/imedia
163 164
22/05/2021
CBIR: BoW with SIFT + histogram CBIR: BoW with SIFT + histogram
Tập đặc
20 ảnh/nhóm trưng
SIFT
5 ảnh/nhóm
~80 ảnh/nhóm
~60 ảnh/nhóm
CSDL mô tả đặc
trưng ảnh SIFT
dưới dạng các
Source :ĐATN – Phạm Xuân Trường K52 - BK vector trọng số
Tập ảnh test Source :Đồ án tốt nghiệp – Phạm Xuân Trường K52 - BK
165 166
169