CAP5415-Computer Vision Lecture 4 - Finding Features (introduction to feature engineering, local features) Guest Lecturer: Prof. Boqing Gong Lecture 4 –Finding Features 1
CAP5415-ComputerVisionLecture4- FindingFeatures(introductiontofeatureengineering,
localfeatures)
GuestLecturer:Prof.Boqing Gong
Lecture4–FindingFeatures
1
Outline
Non-DeepLearningApproaches(IntroductiontoFeatureEngineering)
• Ex1.Key-pointFeatures– Harriscornerdetection
• Ex2.AffineInvariance
• ReadSzeliski,Chapter4.• ReadShah,Chapter2.• Read/ProgramCVwithPython,Chapters1and2.
Lecture4–FindingFeatures
2
MotivationforFeatureFinding:MatchingLecture4–FindingFeatures
3
MotivationforFeatureFinding:Hardercase
Lecture4–FindingFeatures
4Credit:Fei Fei Li
Lecture4–FindingFeatures
5
Top-down processing suggests that we form our perceptions starting with a larger object, concept or idea before working our way toward more detailed information.
In other words, top-down processing happens when we work from the general to the specific; the big picture to the tiny details.
In top-down processing, your abstract impressions can influence the sensory data that you gather.
9/3/15
Lecture4–FindingFeatures
6
Lecture4–FindingFeatures
7
FindingFeaturesinVideos
Lecture4–FindingFeatures
8
Subsequentstudieshaveshownthatmanycomplexactionscanberecognizedonthebasisofsuch'point-lightdisplays',including
• facialexpressions,• SignLanguage,• armmovements,• andvariousfull-bodyactions.
Lecture4–FindingFeatures
9
ChoosinginterestpointsLecture4–FindingFeatures
10
Wherewouldyoutellyourfriendtomeetyou?
Slide Credit: James Hays
Featuresareusedin…• Automate object tracking • Point matching for computing disparity• Motion based segmentation• Object Recognition • 3D Object Reconstruction• Robot Navigation• Image Retrieval/Indexing• ….
Lecture4–FindingFeatures
11
Whatisaninterestpoint?
• Expressivetexture• Thepointatwhichthedirectionoftheboundaryofobjectchangesabruptly
• Intersectionpointbetweentwoormoreedgesegments
Lecture4–FindingFeatures
12
Whatisaninterestpoint?Lecture4–FindingFeatures
13
PropertiesofInterestPoints
• Detect all (or most) true interest points• No false interest points • Well localized• Robust with respect to noise• Efficient detection
Lecture4–FindingFeatures
14
PossibleApproachesforCornerDetection(ex.interestpoint)
• Basedonbrightnessofimages• Usuallyimagederivatives
• Basedonboundaryextraction• Firststepedgedetection• Curvatureanalysisofedges
Lecture4–FindingFeatures
15
CorrespondenceAcrossViews
• Correspondence:matchingpoints,patches,edges,orregionsacrossimages
Lecture4–FindingFeatures
16
≈
GoalsforKeyPointsLecture4–FindingFeatures
17
Detectpointsthatarerepeatable anddistinctive
OverviewofKeyPoint MatchingLecture4–FindingFeatures
18K.Grauman,B.Leibe
Af Bf
A1
A2 A3
Tffd BA
MajorTrade-offsLecture4–FindingFeatures
19
More Repeatable More Interest Points
A1
A2 A3
Detection of interest points
More Distinctive More Flexible
Description of patches
Robust to occlusionWorks with less texture
Minimize wrong matches
Robust detectionPrecise localization
LocalFeatures:MainComponentsLecture4–FindingFeatures
20
1) Detection: Identify the interest points
2) Description: Extract feature vector descriptor surrounding each interest point.
3) Matching: Determine correspondence between descriptors in two views
],,[ )1()1(11 dxx !=x
],,[ )2()2(12 dxx !=x
Kristen Grauman
Goal: interest operator repeatabilityLecture4–FindingFeatures
21
• We want to detect (at least some of) the same points in both images.
• Yet we have to be able to run the detection procedure independently per image.
No chance to find true matches!
Lecture4–FindingFeatures
22
Goal: descriptor distinctiveness• We want to be able to reliably determine
which point goes with which.
• Must provide some invariance to geometricand photometric differences between the two views.
?
Kristen Grauman
Some patches can be localizedor matched with higher accuracy than others
why ?
Lecture4–FindingFeatures
23
• Edge detectors often fail in corners. Why?
• Corner point can be recognized in a window
• Shifting a window in any direction should give a large change in intensity
• LOCALIZINGandUNDERSTANDINGshapes…
Lecture4–FindingFeatures
24
BasicIdeainCornerDetectionLecture4–FindingFeatures
25
“flat” region:no change in all directions
“edge”:no change along the edge direction
“corner”:significant change in all directions
TemplateMatchingLecture4–FindingFeatures
26
2
4�4 5 5�4 5 5�4 �4 �4
3
5
2
45 5 5�4 5 �4�4 �4 �4
3
5
TemplateMatchingLecture4–FindingFeatures
27
2
4�4 5 5�4 5 5�4 �4 �4
3
5
2
45 5 5�4 5 �4�4 �4 �4
3
5
Completesetofeighttemplatescanbegeneratedbysuccessive90degreeofrotations.
TemplateMatchingLecture4–FindingFeatures
28
2
4�4 5 5�4 5 5�4 �4 �4
3
5
2
45 5 5�4 5 �4�4 �4 �4
3
5
Completesetofeighttemplatescanbegeneratedbysuccessive90degreeofrotations.
Whythesummationoffilteris0?
TemplateMatchingLecture4–FindingFeatures
29
2
4�4 5 5�4 5 5�4 �4 �4
3
5
2
45 5 5�4 5 �4�4 �4 �4
3
5
Completesetofeighttemplatescanbegeneratedbysuccessive90degreeofrotations.
Whythesummationoffilteris0? InsensitivetoabsolutechangeInintensity!
CornerDetectionusingtheHessianMatrix
• Cornersarecharacterizedbyhigh-curvatureofintensityvalues.
Lecture4–FindingFeatures
30
H(p) =
Ixx
(p) Ixy
(p)Ixy
(p) Iyy
(p)
�
CornerDetectionusingtheHessianMatrix
• Cornersarecharacterizedbyhigh-curvatureofintensityvalues.
Lecture4–FindingFeatures
31
H(p) =
Ixx
(p) Ixy
(p)Ixy
(p) Iyy
(p)
�
CornerDetectionusingtheHessianMatrix
• Cornersarecharacterizedbyhigh-curvatureofintensityvalues.
Lecture4–FindingFeatures
32
H(p) =
Ixx
(p) Ixy
(p)Ixy
(p) Iyy
(p)
�
HessianMatrixatvoxelp.
CornerDetectionusingtheHessianMatrix
• Cornersarecharacterizedbyhigh-curvatureofintensityvalues.
Lecture4–FindingFeatures
33
H(p) =
Ixx
(p) Ixy
(p)Ixy
(p) Iyy
(p)
�
HessianMatrixatvoxelp.
EigenvaluesoftheHessianindicatecornerfeaturesifbotheigenvaluesarelarge!
CornerDetectionusingtheHessianMatrix
• Cornersarecharacterizedbyhigh-curvatureofintensityvalues.
Lecture4–FindingFeatures
34
H(p) =
Ixx
(p) Ixy
(p)Ixy
(p) Iyy
(p)
�
HessianMatrixatvoxelp.
EigenvaluesoftheHessianindicatecornerfeaturesifbotheigenvaluesarelarge!
Onelarge,onesmalleigenvalues->edgeregions
Twosmalleigenvaluesindicate->flatregions
CornerDetectionusingtheHessianMatrix
• Cornersarecharacterizedbyhigh-curvatureofintensityvalues.
Lecture4–FindingFeatures
35
H(p) =
Ixx
(p) Ixy
(p)Ixy
(p) Iyy
(p)
�
HessianMatrixatvoxelp.
EigenvaluesoftheHessianindicatecornerfeaturesifbotheigenvaluesarelarge!
Onelarge,onesmalleigenvalues->edgeregions
Twosmalleigenvaluesindicate->flatregions
HessianmatrixsummarizesDistributionofgradients.
Reminder:Eigenvalues/EigenvectorsLecture4–FindingFeatures
36
det(H) = Ixx
Iyy
� I2xy
Tr(H) = Ixx
+ Iyy
H(p) =
Ixx
(p) Ixy
(p)Ixy
(p) Iyy
(p)
�
Reminder:Eigenvalues/EigenvectorsLecture4–FindingFeatures
37
det(H) = Ixx
Iyy
� I2xy
Tr(H) = Ixx
+ Iyy
H(p) =
Ixx
(p) Ixy
(p)Ixy
(p) Iyy
(p)
�
TheeigenvaluesofthematrixHaresolutionsofitscharacteristicspolynomial
det(H� �12) = 0
Reminder:Eigenvalues/EigenvectorsLecture4–FindingFeatures
38
det(H) = Ixx
Iyy
� I2xy
Tr(H) = Ixx
+ Iyy
H(p) =
Ixx
(p) Ixy
(p)Ixy
(p) Iyy
(p)
�
TheeigenvaluesofthematrixHaresolutionsofitscharacteristicspolynomial
det(
Ixx
(p)� � Ixy
(p)Ixy
(p) Iyy
(p)� �
�) = 0
det(H� �12) = 0
Reminder:Eigenvalues/EigenvectorsLecture4–FindingFeatures
39
det(H) = Ixx
Iyy
� I2xy
Tr(H) = Ixx
+ Iyy
H(p) =
Ixx
(p) Ixy
(p)Ixy
(p) Iyy
(p)
�
TheeigenvaluesofthematrixHaresolutionsofitscharacteristicspolynomial
det(
Ixx
(p)� � Ixy
(p)Ixy
(p) Iyy
(p)� �
�) = 0
det(H� �12) = 0
(Ixx
(p)� �)(Iyy
(p)� �)� Ixy
(p)2 = 0
HarrisandStephensCornerDetector
• InsteadofusingHessian ofimageI,usefirstderivativeofsmoothedI (i.e.,L)
Lecture4–FindingFeatures
40
G(p,�) =
L2x
(p,�) Lx
(p,�)Ly
(p,�)Lx
(p,�)Ly
(p,�) L2y
(p,�)
�
HarrisandStephensCornerDetector
• InsteadofusingHessian ofimageI,usefirstderivativeofsmoothedI (i.e.,L)
Lecture4–FindingFeatures
41
G(p,�) =
L2x
(p,�) Lx
(p,�)Ly
(p,�)Lx
(p,�)Ly
(p,�) L2y
(p,�)
�
• Insteadofcalculatingeigenvalues,wewillconsidercornerness feature:
HarrisandStephensCornerDetector
• InsteadofusingHessian ofimageI,usefirstderivativeofsmoothedI (i.e.,L)
Lecture4–FindingFeatures
42
G(p,�) =
L2x
(p,�) Lx
(p,�)Ly
(p,�)Lx
(p,�)Ly
(p,�) L2y
(p,�)
�
• Insteadofcalculatingeigenvalues,wewillconsidercornerness feature:
H(p,�,↵) = det(G)� ↵.T r(G)forsmallalpha(=1/25)
HarrisandStephensCornerDetectorLecture4–FindingFeatures
43
H(p,�,↵) = �1�2 � ↵.(�1 + �2)
HarrisandStephensCornerDetector
• ThesamebehaviorasHessianbaseddetector,butnowwedirectlyusesimpledeterminantandtrace functions!
Lecture4–FindingFeatures
44
H(p,�,↵) = �1�2 � ↵.(�1 + �2)
H(p,�,↵) = det(G)� ↵.T r(G)
HarrisandStephensCornerDetector
• ThesamebehaviorasHessianbaseddetector,butnowwedirectlyusesimpledeterminantandtrace functions!
Lecture4–FindingFeatures
45
H(p,�,↵) = �1�2 � ↵.(�1 + �2)
H(p,�,↵) = det(G)� ↵.T r(G)
Othercornernessmeasures:or�1�2
�1 + �2�1 � ↵�2
Harmonicmean Triggs
Lecture4–FindingFeatures
46
Lecture4–FindingFeatures
47
Ix Iy
Ix2 Iy2 IxIy
Squareofderivatives
GaussianSmoothing
FeatureExtraction:CornersLecture4–FindingFeatures
489300 Harris Corners Pkwy, Charlotte, NC
InvariantLocalFeaturesLecture4–FindingFeatures
49
•Image content is transformed into local feature coordinates that are invariant to translation, rotation, scale, and other imaging parameters
Features Descriptors
InvarianceandCovariance• We want corner locations to be invariant to photometric
transformations and covariant to geometric transformations– Invariance: image is transformed and corner locations do not
change– Covariance: if we have two transformed versions of the same
image, features should be detected in corresponding locations
Lecture4–FindingFeatures
50
AffineTransformationLecture4–FindingFeatures
51
translation
AffineTransformationLecture4–FindingFeatures
52
rotation
translation
AffineTransformationLecture4–FindingFeatures
53
rotation
translation
scaling
AffineTransformationLecture4–FindingFeatures
54
rotation
translation
scaling
Cornersareinvariantto
✔
✔
✖
NextLecture
• WewillcontinueAffineInvarianceconcept• Introducetheconceptofscale-spaceapproaches
• Introduce“famous”SIFTalgorithm(Lowe’sScaleinvariantfeaturetransform)
Lecture4–FindingFeatures
55
Questions?Lecture4–FindingFeatures
56