I t l l iti Instance-level recognition
Cordelia Schmid INRIA
I Instance-level recognition t l l iti Cordelia Schmid INRIA - - PowerPoint PPT Presentation
I Instance-level recognition t l l iti Cordelia Schmid INRIA Instance-level recognition Instance level recognition Particular objects and scenes large databases Particular objects and scenes, large databases Application pp Search
I t l l iti Instance-level recognition
Cordelia Schmid INRIA
Instance-level recognition Instance level recognition
Particular objects and scenes large databases Particular objects and scenes, large databases
Application
Search photos on the web for particular places
pp
p p p
Find these landmarks ...in these images and 1M more
Applications Applications
Take a picture of a product or advertisement
find relevant information on the web [Google Goggles, Milpix Pixee]
Applications Applications
Search in 200h of video Query video
Difficulties
Find the object despite
– large changes in scale, viewpoint, lighting – crop and occlusion not much texture/structure – not much texture/structure
Viewpoint Scale Lighting Occlusion
Difficulties Difficulties
Very large images collection need for efficient indexing
Flickr has 2 billions photographs more than 1 million added daily – Flickr has 2 billions photographs, more than 1 million added daily – Facebook has 15 billions images (~27 million added daily) – Facebook has 15 billions images ( 27 million added daily) – Large personal collections Large personal collections – Video collections with a large number of videos, i.e., YouTube g
Approach: matching local invariant descriptors
I i f d i l l f h
Approach: matching local invariant descriptors
Image content is transformed into local features that are invariant to geometric and photometric transformations
Local Features
8
Local Features, e.g. SIFT
S lide credit: David Lowe
[Lowe04]
Overview Overview
Local features Local features
local descriptor
Several / many local descriptors per image Robust to occlusion/clutter + no object segmentation required Robust to occlusion/clutter + no object segmentation required Photometric : distinctive Invariant : to image transformations + illumination changes
Local features: interest points Local features: interest points
Local features: Contours/segments Local features: Contours/segments
Local features: segmentation Local features: segmentation
Local features Local features
1) Extraction of local features 1) Extraction of local features
– Contours/segments – Interest points & regions Interest points & regions – Regions by segmentation – Dense features, points on a regular grid
2) Description of local features
– Dependant on the feature type – Contours/segments angles, length ratios I t t i t l l di t hi t – Interest points greylevels, gradient histograms – Regions (segmentation) texture + color distributions
Line matching Line matching
Extraction de contours
– Zero crossing of Laplacian – Local maxima of gradients Local maxima of gradients
p ( y )
g
Description of segments
– Mi-point, length, orientation, angle between pairs etc.
Experimental results – line segments Experimental results line segments
images 600 x 600
Experimental results – line segments Experimental results line segments
248 / 212 line segments extracted
Experimental results – line segments Experimental results line segments
89 matched line segments - 100% correct
Experimental results – line segments Experimental results line segments
3D reconstruction
Problems of line segments Problems of line segments
Often only partial extraction
– Line segments broken into parts – Missing parts Missing parts
Information not very discriminative
– 1D information – Similar for many segments
– Pairs and triplets of segments – Interest points
Example results - interest points Example results interest points
I t t i t t t d ith H i d t t ( 500 i t ) Interest points extracted with Harris detector (~ 500 points)
Matching interest points Matching interest points
Find corresponding locations in the image Find corresponding locations in the image
Matching Matching interest points Matching Matching interest points
I t t i t t h d b d l ti (188 i ) Interest points matched based on cross-correlation (188 pairs)
constrai Matching interest points constrai
Global constraint Robust estimation of the fundamental matrix
Matching interest points
Global constraint - Robust estimation of the fundamental matrix 99 inliers 89 outliers 99 inliers 89 outliers
Application: Panorama stitching pp g
Images courtesy of A. Zisserman.
Overview Overview
Harris detector [Harris & Stephens’88] Harris detector [Harris & Stephens 88]
B d th id f t l ti Based on the idea of auto-correlation I t t diff i ll di ti i t t i t Important difference in all directions => interest point
Harris detector Harris detector
2
)) ( ) ( ( ) ( I I A
Auto-correlation function for a point and a shift
) , ( y x ) , ( y x
2 ) , ( ) , (
)) , ( ) , ( ( ) , ( y y x x I y x I y x A
k k k y x W y x k
k k
) ( y x
W
) , ( y x
Harris detector Harris detector
2
)) ( ) ( ( ) ( I I A
Auto-correlation function for a point and a shift
) , ( y x ) , ( y x
2 ) , ( ) , (
)) , ( ) , ( ( ) , ( y y x x I y x I y x A
k k k y x W y x k
k k
) ( y x
W
) , ( y x
small in all directions large in one directions
) , ( y x A {
→ uniform region → contour g large in all directions
) , ( y{
→ interest point
Harris detector Harris detector
Harris detector Harris detector
Discret shifts are avoided based on the auto-correlation matrix
x y x I y x I y x I y y x x I )) ( ) ( ( ) ( ) (
with first order approximation
y y x I y x I y x I y y x x I
k k y k k x k k k k
)) , ( ) , ( ( ) , ( ) , (
2 ) , ( ) , (
)) , ( ) , ( ( ) , ( y y x x I y x I y x A
k k k y x W y x k
k k
2 ) (
) , ( ) , (
W y x k k y k k x
k ky x y x I y x I
) , (
W y x
k ky
Harris detector Harris detector
x y x I y x I y x I
W k k y k k x W k k x ) ( ) ( 2
) , ( ) , ( )) , ( (
y x y x I y x I y x I y x
W y x k k y W y x k k y k k x W y x W y x
k k k k k k k k) , ( 2 ) , ( ) , ( ) , (
)) , ( ( ) , ( ) , (
Auto-correlation matrix the sum can be smoothed with a Gaussian the sum can be smoothed with a Gaussian
x I I I G
y x x 2
y I I I G y x
y y x y x x 2
Harris detector Harris detector
Auto correlation matrix
2
) (
y x x
I I I
2
) , (
y y x y x x
I I I G y x A
– captures the structure of the local neighborhood measure based on eigenvalues of this matrix – measure based on eigenvalues of this matrix
=> interest point => contour
Interpreting the eigenvalues Interpreting the eigenvalues
Classification of image points using eigenvalues of autocorrelation matrix:
2 “Edge” 2 >> 1 “Corner” 1 and 2 are large, 2 >> 1 1 ~ 2; \ 1 and 2 are small; “Edge” 1 >> 2 “Flat” region 1
Corner response function Corner response function
2 2 1 2 1 2
) ( ) ( trace ) det( A A R
“Corner” “Edge” R < 0
2 1 2 1
) ( ) ( ) (
α: constant (0.04 to 0.06)
“Corner” R > 0 R < 0 |R| small “Edge” R < 0 “Flat” region
Harris detector Harris detector
C f ti
2 2 1 2 1 2
) ( )) ( ( ) det( k A trace k A f
2 1 2 1
) ( )) ( ( ) ( f
R d th ff t f t t Reduces the effect of a strong contour
– Treshold (absolut, relatif, number of corners) – Local maxima
) , ( ) , ( 8 , y x f y x f
neighbourh y x thresh f
Harris Detector: Steps Harris Detector: Steps
Harris Detector: Steps Harris Detector: Steps
Compute corner response R
Harris Detector: Steps Harris Detector: Steps
Find points with large corner response: R>threshold
Harris Detector: Steps Harris Detector: Steps
Take only the points of local maxima of R
Harris Detector: Steps Harris Detector: Steps
Harris detector: Summary of steps Harris detector: Summary of steps
1. Compute Gaussian derivatives at each pixel 2. Compute second moment matrix A in a Gaussian i d d h i l window around each pixel 3. Compute corner response function R 4. Threshold R 5. Find local maxima of response function (non-maximum i ) suppression)
Harris - invariance to transformations Harris invariance to transformations
Geometric transformations
– translation – rotation i ilit d ( t ti l h ) – similitude (rotation + scale change) – affine (valide for local planar objects) ( p j )
– Affine intensity changes (I a I + b)
Harris Detector: Invariance Properties Harris Detector: Invariance Properties
Ellipse rotates but its shape (i.e. eigenvalues) remains the same remains the same Corner response R is invariant to image rotation Corner response R is invariant to image rotation
Harris Detector: Invariance Properties Harris Detector: Invariance Properties
Only derivatives are used => invariance to intensity shift I I + b to intensity shift I I + b Intensity scale: I a I R R
threshold
x (image coordinate) x (image coordinate) ll ffi i i h Partially invariant to affine intensity change, dependent on type of threshold
Harris Detector: Invariance Properties Harris Detector: Invariance Properties
Scaling
Corner All points will be classified as edges
Not invariant to scaling
Comparison of patches - SSD Comparison of patches SSD
Comparison of the intensities in the neighborhood of two interest points Comparison of the intensities in the neighborhood of two interest points
) , (
1 1 y
x
) , (
2 2 y
x
image 1 image 2 g g
SSD : sum of square difference
2 2 2 2 1 1 1 ) 1 2 ( 1
)) , ( ) , ( (
2j y i x I j y i x I
N N i N N j N
Small difference values similar patches
Comparison of patches Comparison of patches
2 1
)) ( ) ( ( j y i x I j y i x I
N N
SSD
2 2 2 1 1 1 ) 1 2 (
)) , ( ) , ( (
2j y i x I j y i x I
N i N j N
SSD : Invariance to photometric transformations? Invariance to photometric transformations? Intensity changes (I I + b) > N li i ith th f h t h
2 2 2 2 2 1 1 1 1 ) 1 2 ( 1
)) ) , ( ( ) ) , ( ((
2m j y i x I m j y i x I
N N i N N j N
=> Normalizing with the mean of each patch Intensity changes (I aI + b)
N i N j
2
) ( ) (
N N
m j y i x I m j y i x I
=> Normalizing with the mean and standard deviation of each patch
2 2 2 2 2 1 1 1 1 1 ) 1 2 ( 1
) , ( ) , (
2
N i N j N
m j y i x I m j y i x I
Cross-correlation ZNCC Cross correlation ZNCC
li d SSD
2 2 2 2 2 1 1 1 1 1
) , ( ) , (
N N
m j y i x I m j y i x I zero normalized SSD
2 2 2 2 2 1 1 1 1 1 ) 1 2 ( 1
2
N i N j N
ZNCC: zero normalized cross correlation
2 2 2 2 1 1 1 1 ) 1 2 ( 1
) , ( ) , (
2 m j y i x I m j y i x I
N N N
2 1 ) 1 2 (
N i N j N
ZNCC values between -1 and 1 1 when identical patches ZNCC values between 1 and 1, 1 when identical patches in practice threshold around 0.5
Introduction to local descriptors Introduction to local descriptors
Greyvalue derivatives
Diff ti l i i t
[K d i k’87]
SIFT d i t
Greyvalue derivatives: Image gradient Greyvalue derivatives: Image gradient
intensity
– how does this relate to the direction of the edge?
Differentiation and convolution Differentiation and convolution
f f x y
f x y
f x lim
0
f x , y
f x,y
f f xn1,y
f xn, y
pp x x
1
Finite difference filters Finite difference filters
Oth i ti f d i ti filt i t
Effects of noise Effects of noise
g g
– Plotting intensity as a function of position gives a signal
Solution: smooth first Solution: smooth first
f g f * g f g
d ) ( g f dx d
) ( g f dx d
Derivative theorem of convolution
Derivative theorem of convolution
, associative:
g dx d f g f dx d ) (
f
g dx d
g d f g dx f
Local descriptors Local descriptors
G ey a ue de at es
– Convolution with Gaussian derivatives ) ( ) , ( ) ( ) , (
xG y x I G y x I ) ( * ) ( ) ( * ) , ( ) ( * ) , ( ) , (
xx yG y x I G y x I G y x I y x v ) ( * ) , ( ) ( * ) , (
yy xyG y x I G y x I
y d x d y y x x I y x G G y x I ) , ( ) , , ( ) ( ) , (
) 2 exp( 2 1 ) , , (
2 2 2 2
y x y x G
y y y y y ) ( ) ( ) ( ) (
Local descriptors Local descriptors
Notation for greyvalue derivatives [Koenderink’87]
) , ( ) ( ) , ( y x L G y x I
Notation for greyvalue derivatives [Koenderink’87]
) , ( ) , ( ) , ( ) ( * ) , ( ) ( ) , ( ) ( ) , ( y x L y x L y G y x I G y x I y
y x y x
) , ( ) , ( ) , ( ) ( * ) , ( ) ( * ) , ( ) ( ) , ( ) , ( y x L y x L y G y x I G y x I y y x
xy xx y xy xx y
v ) , ( ) , ( ) ( * ) , ( ) ( ) , ( y x L y G y x I y
yy xy yy xy
I i ? Invariance?
Local descriptors – rotation invariance Local descriptors rotation invariance
I i t i t ti diff ti l i i t Invariance to image rotation : differential invariants [Koen87]
L
y y x x
L L L L L L L L L L L L L 2
gradient magnitude
yy xx yy yy y x xy x x xx
L L L L L L L L L L L L L L L L 2 2
Laplacian
yy yy xy xy xx xx
L L L L L L 2
Laplacian of Gaussian (LOG) Laplacian of Gaussian (LOG)
) ( ) (
yy xx
G G LOG
SIFT descriptor [Lowe’99] SIFT descriptor [Lowe 99]
– 8 orientations of the gradient – 4x4 spatial grid – Dimension 128 – soft-assignment to spatial bins – normalization of the descriptor to norm one normalization of the descriptor to norm one – comparison with Euclidean distance gradient 3D histogram image patch
x
y
Local descriptors - rotation invariance Local descriptors rotation invariance
E ti ti f th d i t i t ti
– extract gradient orientation histogram over gradient orientation – histogram over gradient orientation – peak in this histogram
2
Local descriptors – illumination change Local descriptors illumination change
in case of an affine transformation
b aI I ) ( ) (
2 1
x x
in case of an affine transformation
b aI I ) ( ) (
2 1
x x
Local descriptors – illumination change Local descriptors illumination change
in case of an affine transformation
b aI I ) ( ) (
2 1
x x
in case of an affine transformation
b aI I ) ( ) (
2 1
x x N li ti f d i ti ith di t it d
L L L L L L ) (
y y x x yy xx
L L L L L L ) (
Local descriptors – illumination change Local descriptors illumination change
in case of an affine transformation
b aI I ) ( ) (
2 1
x x
in case of an affine transformation
b aI I ) ( ) (
2 1
x x N li ti f d i ti ith di t it d
L L L L L L ) (
y y x x yy xx
L L L L L L ) (
Invariance to scale changes Invariance to scale changes
– In case of a convolution with Gaussian derivatives defined by – In case of a convolution with Gaussian derivatives defined by
y d x d y y x x I y x G G y x I ) , ( ) , , ( ) ( ) , (
) 2 exp( 2 1 ) , , (
2 2 2 2
y x y x G
y d x d y y x x I y x G G y x I ) , ( ) , , ( ) ( ) , (
2 2
2 2