precept 6: quiz review - princeton university3dvision.princeton.edu › ... › slides › ... ›...
TRANSCRIPT
Precept 6: Quiz ReviewQuiz Date: Thursday Dec 17
Format
• 50 minutes• 6 problems, 10 points each• A one-‐page double-‐sided letter-‐size color cheat sheet allowed• Similar to the review questions in format and in topic• Mostly conceptual
Problem 1: Affine Transformations
2D Geometric Transformations
2D Geometric Transformations
• Transformation T is a coordinate-‐changing machine:• p’ = T(p)
• Transformation T is global• Is the same for any point p• Can be described by just a few parameters
T
p = (x,y) p’ = (x’,y’)
Linear Transformation
Common linear transformations
• Uniform scaling by s:
(0,0) (0,0)
Common linear transformations
• Rotation by angle θ (about the origin)
(0,0) (0,0)θ
2x2 Matrices• What types of transformations can be represented with a 2x2 matrix?
2D mirror about Y axis?
2D mirror across line y = x?
Translation
• Solution: homogeneous coordinates to the rescue
Affine transformations
any transformation with last row [ 0 0 1 ] we call an affine transformation
Affine transformations
• Affine transformations are combinations of …• Linear transformations, and• Translations
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡=
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡
wyx
fedcba
wyx
100''
Problem 1: Affine Transformations
1) How many degrees of freedom does an affine transformation have?
Problem 1: Affine Transformations
1) How many degrees of freedom does an affine transformation have?
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡=
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡
wyx
fedcba
wyx
100''
Problem 1: Affine Transformations
2) Determine whether the below properties of affine transformations are true/false.
a. Origin will be mapped to origin
Problem 1: Affine Transformations
2) Determine whether the below properties of affine transformations are true/false.
a. Origin will be mapped to originFalse: Translation
Problem 1: Affine Transformations
2) Determine whether the below properties of affine transformations are true/false.
b. Lines will be mapped to lines
Problem 1: Affine Transformations
2) Determine whether the below properties of affine transformations are true/false.
b. Lines will be mapped to linesTrue: y = mx + n
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡=
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡
wyx
fedcba
wyx
100''
Problem 1: Affine Transformations
2) Determine whether the below properties of affine transformations are true/false.
b. Lines will be mapped to linesTrue: y = mx + n
x’ = ax + by + cw = ax + b(mx + n) + cw = (a + bm)x + bn + cwy’ = dx + ey + fw = dx + e(mx + n) + fw = (d + em)x + en + fw
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡=
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡
wyx
fedcba
wyx
100''
Problem 1: Affine Transformations
2) Determine whether the below properties of affine transformations are true/false.
b. Lines will be mapped to linesTrue: y = mx + n
x’ = ax + by + cw = ax + b(mx + n) + cw = (a + bm)x + bn + cwy’ = dx + ey + fw = dx + e(mx + n) + fw = (d + em)x + en + fw
⇒ x = (x’ – bn – cw)/(a+bm)⇒ y’ = (d + em)/(a + bm) (x’ – bn – cw) + en + fw
y’ = (d + em)/(a + bm) x’ – (bn+cw)(d + em)/(a + bm) + en + fw
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡=
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡
wyx
fedcba
wyx
100''
Problem 1: Affine Transformations
2) Determine whether the below properties of affine transformations are true/false.
c. Parallel lines will not remain parallel
Problem 1: Affine Transformations
2) Determine whether the below properties of affine transformations are true/false.
c. Parallel lines will not remain parallelFalse:y = mx + n1y = mx + n2
y’ = (d + em)/(a + bm) x’ – (bn1+cw)(d + em)/(a + bm) + en1 + fwy’ = (d + em)/(a + bm) x’ – (bn2+cw)(d + em)/(a + bm) + en2 + fw
Problem 1: Affine Transformations
2) Determine whether the below properties of affine transformations are true/false.
d. Ratios (along any line) will be preserved
Problem 1: Affine Transformations
2) Determine whether the below properties of affine transformations are true/false.
d. Ratios (along any line) will be preserved True:(x1, mx1+n, w) ⇒ (ax1 + b(mx1+n) + cw, dx1 + e(mx1+n) + fw, w)(x2, mx2+n, w)⇒ (ax2 + b(mx2+n) + cw, dx2 + e(mx2+n) + fw, w)
Problem 1: Affine Transformations
2) Determine whether the below properties of affine transformations are true/false.
d. Ratios (along any line) will be preserved True:(x1, mx1+n, w) ⇒ (ax1 + b(mx1+n) + cw, dx1 + e(mx1+n) + fw, w)(x2, mx2+n, w)⇒ (ax2 + b(mx2+n) + cw, dx2 + e(mx2+n) + fw, w)
⇒ |X1X2|2 = (1 + m2)(x2 – x1)2⇒ |X1’X2’|2 = ((a + bm)2 + (d + em)2) (x2 – x1)2
Problem 1: Affine Transformations
2) Determine whether the below properties of affine transformations are true/false.
e. The transformation is not closed under composition
Problem 1: Affine Transformations
2) Determine whether the below properties of affine transformations are true/false.
e. The transformation is not closed under composition False:
Problem 2: Filtering
What does it do?• Replaces each pixel with an average of its neighborhood
• Achieve smoothing effect (remove sharp features)
111
111
111
Slide credit: David Lowe (UBC)
],[g ⋅⋅
Box Filter
Smoothing with box filter
Practice with linear filters
000
010
000
Original
?
Source: D. Lowe
Practice with linear filters
000
010
000
Original Filtered (no change)
Source: D. Lowe
Practice with linear filters
000
100
000
Original
?
Source: D. Lowe
Practice with linear filters
000
100
000
Original Shifted leftBy 1 pixel
Source: D. Lowe
Practice with linear filters
Original
111111111
000020000 - ?
(Note that filter sums to 1)
Source: D. Lowe
Practice with linear filters
Original
111111111
000020000 -
Sharpening filter- Accentuates differences with local average
Source: D. Lowe
Sharpening
Source: D. Lowe
Other filters
-101
-202
-101
Vertical Edge(absolute value)
Sobel
Other filters
-1-2-1
000
121
Horizontal Edge(absolute value)
Sobel
Problem 2: Filtering
1) Briefly explain what the effects would kernel 1 and kernel 2 produce when applied to a 2-‐D image.
Problem 2: Filtering
2) Please design a 1-‐D width-‐3 sharpening filter
Problem 2: Filtering
2) Please design a 1-‐D width-‐3 sharpening filter
020 111− 13
Problem 2: Filtering
2) and apply it to the above image and show the result.
Problem 3: Camera Parameters
The Camera Matrix
x = K R t!" #$X
The Extrinsic Matrix
The Intrinsic Matrix
Focal Length, fx, fy
Principal Point Offset, x0, y0
Skew
K =
f 0 px0 f py0 0 1
!
"
####
$
%
&&&&
K =
fx s px0 fy py0 0 1
!
"
####
$
%
&&&&
Problem 3: Camera Parameters
1) Briefly explain what information is embedded in the camera matrices R, K, and t.
R: The directions of the world-‐axes in camera coordinates. K: Focal length, principle point offset, and axis skew.t: The position of the world origin in camera coordinates.
1) Given a 3-‐D point X = (X,Y,Z) and the camera matrices R, K, and t, give the expression for the image coordinates of the point.
Problem 4: Fundamental Matrix
Fundamental matrix
• This epipolar geometry of two views is described by a Very Special 3x3 matrix , called the fundamental matrix• maps (homogeneous) points in image 1 to lines in image 2!• The epipolar line (in image 2) of point p is:
• Epipolar constraint on corresponding points:
epipolar plane
epipolar lineepipolar line
0
(projection of ray)
Image 1 Image 2
Problem 4: Fundamental MatrixWhat is the difference between a fundamental matrix and a homography? Both of them can be estimated by some point to point correspondences from two images. When should we use which, and why?
Problem 4: Fundamental MatrixWhat is the difference between a fundamental matrix and a homography? Both of them can be estimated by some point to point correspondences from two images. When should we use which, and why?
Homography is only a transformation between two 2D plannar structure, including warping between two plannar objects or warping between two images taken at the same camera center. Fundamental matrix models the generic relationship between any two images taken towards the same 3D world.
Problem 5: RANSAC
Estimating F
• If we don’t know K1, K2, R, or t, can we estimate F for two images?
• Yes, given enough correspondences
Estimating F – 8-‐point algorithm
• The fundamental matrix F is defined by
0=ΤFxx'for any pair of matches x and x’ in two images.
• Let x=(u,v,1)T and x’=(u’,v’,1)T,⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
=
333231
232221
131211
fffffffff
F
each match gives a linear equation
0'''''' 333231232221131211 =++++++++ fvfuffvfvvfuvfufvufuu
8-‐point algorithm
0
1´´´´´´
1´´´´´´1´´´´´´
33
32
31
23
22
21
13
12
11
222222222222
111111111111
=
⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
fffffffff
vuvvvvuuuvuu
vuvvvvuuuvuuvuvvvvuuuvuu
nnnnnnnnnnnn
!!!!!!!!!
• In reality, instead of solving , we seek f to minimize , least eigenvector of .
0=AfAf AAΤ
8-‐point algorithm
• Pros: it is linear, easy to implement and fast• Cons: susceptible to noise
Problem 5: RANSACList the major steps of the RANSAC algorithm in the context of estimating a fundamental matrix from point-‐to-‐point correspondences between two images.
Problem 5: RANSACList the major steps of the RANSAC algorithm in the context of estimating a fundamental matrix from point-‐to-‐point correspondences between two images.
• For many times• Pick 8 points• Compute a solution for 𝑭 using these 8 points• Count number of inliers that with 𝒙()𝑭𝒙* close to 0
• Pick the one with the largest number of inliers
Problem 6: Deep Learning
Gradient Descent
Stochastic Gradient Descent
Problem 6: Deep LearningWhat is the stochastic gradient descent algorithm? Why do we need this algorithm for training deep convolutional neural network?
The stochastic gradient descent algorithm estimates gradient of the loss function by computing it for a small sample of randomly chosen training inputs. By averaging over this small sample we can quickly get a good estimate of the true gradient, thereby speeding up gradient descent, and thus learning. This algorithm is important in training deep convolutional neural network in which case the number of training inputs is very large because it helps speed up the learning.
See you on Thursday!