Académique Documents
Professionnel Documents
Culture Documents
Marcus Magnor
Organizational Things
Overview
• Today
– Spatial filtering
– Edge detection
– Line detection
– Feature points
– Finding correspondences
– RANSAC
• Next time
– Photometric calibration
Spatial Filtering
p1 p2 p3
• Image pixel neighborhood (3x3 pixels) p
4 p5 p 6
p7 p8 p 9
w1 w2 w3
• Filter kernel (3x3 pixels) w
4 w5 w6
w7 w8 w9
Low-Pass Filtering
Different Kernel Sizes Mean vs. Median Filtering
∂ I ∂I
• Gradient of 2D image (vector !) ∇I = ,
∂x ∂y
• Direction of gradient ∂I ∂I
tan− 1 /
∂y ∂x
• Derivative filters 0 1
− 1 0
1 0
0 −1
– Robert’s Cross operator
− 1 − 1 − 1 − 1 0 1
∂I ∂I
= 0 0 0 = − 1 0 1
∂y ∂x
– Prewitt operator 1 1 1 − 1 0 1
− 1 − 2 − 1 − 1 0 1
∂I ∂I
– Sobel operator =0 0 0 = − 2 0 2
∂y ∂x
1 2 1 − 1 0 1
Noise Suppression
• Maximum of 1. derivative ∂2 I ∂ 2 I
∇ 2I = +
= zero-crossing of 2. derivative ∂x 2 ∂ y2
• Laplacian of image
– 1. Smooth with Gaussian
– 2. Calculate 2. Derivative
⇒ Convolve with Laplacian
of Gaussian
⇒ Marr-Hildreth operator
– Mexican Hat Operator
• Find zero-crossings
– Convert to binary image <>0
Marr-Hildreth Operator
• Idea
– Find maxima of partial derivative orthogonal to edge direction
– Smooth signal along edge direction
• Algorithm
– Smooth image (Convolve with Gaussian)
– Calculate partial derivatives
– For each pixel, remember direction of largest derivative
– Non-maximal suppression: keep only local peaks
– Store connected sets of edge points in lists
– Eliminate insignificant edges (thresholding hysteresis)
– Upper & lower threshold: keep pixels above upper threshold and
all connected pixels above lower threshold
− 1 − 1 − 1
• Horizontal 2 2 2
− 1 − 1 − 1
− 1 2 − 1
• Vertical − 1 2 − 1
− 1 2 − 1
• 45° diagonals − 1 − 1 2 2 − 1 − 1
− 1 2 − 1 − 1 2 − 1
2 − 1 − 1 − 1 − 1 2
Hough Transform
• Naïve approach
– 1. Detect isolated maxima − 1 − 1 − 1
− 1 8 − 1
– High-pass filter
− 1 − 1 − 1
– 2. Thresholding
– Detects mainly pepper noise
∂I
2
∂I ∂I
∑ ∑ Corner response function
W ∂x W ∂ x ∂y
M = (correlation over local neighborhood W)
∂I ∂I ∂I
2
∑ ∑ ∂y
W ∂x ∂y W R = det M − k (traceM)
2
k = 0.04
– Sum-of-Absolute-Difference N / 2 −1 N / 2 −1
SSE = ∑ ∑ ( I (x + i , y + j ) − I '( x'+i , y '+ j ))
2
– Cross-correlation
i = −N / 2 j =− N / 2
between pixel blocks
l Only relative luminance,
C = ∑ ∑ (I ( x + i , y + j ) − Iˆ )⋅(I ' (x '+ i, y '+ j ) − Iˆ')
N / 2 −1 N / 2 −1
independent of absolute i =− N / 2 j =− N / 2
image intensity
l Î: mean image block luminance
N / 2 −1 N / 2 −1
C= ∑ ∑ (I (x + i , y + j ) − I )⋅(I ' ( x'+i , y '+ j ) − I ')
i =− N / 2 j =− N / 2
Correspondence Matching
Wrap-Up
• Spatial filtering in the image domain
• Image gradient calculation
• Edge pixel detection
• Gradient map
• Marr-Heredith
• Canny Edge Detector
• Straight line identification: Hough transform
• Feature points: Harris Corner Detector
• Correspondence Matching
• Block-based
• SAD, SSE, cross correlation
• RANSAC: robust estimation when outliers are present
• On web page
• Automatically create panorama from images
– Use Sobel gradient operators to implement Harris Corner
detector
– Find point features
– Determine correspondences
– Estimate affine transformations
– Use RANSAC to find optimal transformation matrices
– (Implement true projective transformation)
• Due May 19
– Show me your work starting at 3:30pm
xi xi '
x i = yi ⇔ x i ' = yi '
w w '
i i
Newton Minimization
f ( x0 + ∆) = f ( x 0 ) + J∆ J : Jacobian
1∀i = j
N ' ∆ = J Teˆ N ′ij = (1 + δ ijλ ) ⋅ N ij δ ij =
0∀i ≠ j
Initialize λ to a small value (e.g., 0.001)
• Evaluate Newton scheme once
• If the value obtained for ∆ reduces the error, accept the increment
and divide λ by 10 before the next iteration
• If the error increases, multiply λ by 10 and solve augmented equation
again, until an increment is obtained that reduces the error
• For large λ, the method approaches a steepest descent