Download - Epipolar lines

Transcript
Page 1: Epipolar  lines

Epipolar lines

epipolar linesepipolar lines

BaselineO O’

epipolar plane

𝑝 ′𝑇 𝐸𝑝=0

Page 2: Epipolar  lines

Rectification

β€’ Rectification: rotation and scaling of each camera’s coordinate frame to make the epipolar lines horizontal and equi-height,by bringing the two image planes to be parallel to the baseline

β€’ Rectification is achieved by applying homography to each of the two images

Page 3: Epipolar  lines

Rectification

BaselineO O’

π‘ž ′𝑇𝐻 π‘™βˆ’π‘‡ πΈπ»π‘Ÿ

βˆ’1π‘ž=0

𝐻 𝑙 π»π‘Ÿ

Page 4: Epipolar  lines

Cyclopean coordinatesβ€’ In a rectified stereo rig with baseline of length ,

we place the origin at the midpoint between the camera centers.

β€’ a point is projected to:– Left image: , – Right image: ,

β€’ Cyclopean coordinates:

Page 5: Epipolar  lines

Disparity

β€’ Disparity is inverse proportional to depthβ€’ Constant disparity constant depthβ€’ Larger baseline, more stable reconstruction of depth

(but more occlusions, correspondence is harder)

(Note that disparity is defined in a rectified rig in a cyclopean coordinate frame)

Page 6: Epipolar  lines

Random dot stereogram

β€’ Depth can be perceived from a random dot pair of images (Julesz)

β€’ Stereo perception is based solely on local information (low level)

Page 7: Epipolar  lines

Moving random dots

Page 8: Epipolar  lines

Compared elements

β€’ Pixel intensitiesβ€’ Pixel colorβ€’ Small window (e.g. or ), often using

normalized correlation to offset gainβ€’ Features and edges (less common)β€’ Mini segments

Page 9: Epipolar  lines

Dynamic programming

β€’ Each pair of epipolar lines is compared independently

β€’ Local cost, sum of unary term and binary term– Unary term: cost of a single match– Binary term: cost of change of disparity (occlusion)

β€’ Analogous to string matching (β€˜diff’ in Unix)

Page 10: Epipolar  lines

String matchingβ€’ Swing β†’ String

S t r i n g

S w i n g

Start

End

Page 11: Epipolar  lines

String matchingβ€’ Cost: #substitutions + #insertions + #deletions

S t r i n g

S w i n g

Page 12: Epipolar  lines
Page 13: Epipolar  lines

Dynamic Programming

β€’ Shortest path in a gridβ€’ Diagonals: constant disparityβ€’ Moving along the diagonal – pay unary cost

(cost of pixel match)β€’ Move sideways – pay binary cost, i.e. disparity

change (occlusion, right or left)β€’ Cost prefers fronto-parallel planes. Penalty is

paid for tilted planes

Page 14: Epipolar  lines

Dynamic Programming

Start

, Complexity?

Page 15: Epipolar  lines

Probability interpretation: Viterbi algorithm

β€’ Markov chain

β€’ States: discrete set of disparity

β€’ Log probabilities: product sumβ€’ Maximum likelihood: minimize sum of negative

logsβ€’ Viterbi algorithm: equivalent to shortest path

Page 16: Epipolar  lines

Markov Random Field

β€’ Graph β€’ In our case: graph is

a 4-connected grid

β€’ Minimize energy of the form

β€’ Interpreted as negative log probabilities

Page 17: Epipolar  lines

Iterated Conditional Modes (ICM)

β€’ Initialize states (= disparities) for every pixelβ€’ Update repeatedly each pixel by the most likely

disparity given the values assigned to its neighbors:

β€’ Markov blanket: the state of a pixel only depends on the states of its immediate neighbors

β€’ Similar to Gauss-Seidel iterationsβ€’ Slow convergence to bad local minimum

Page 18: Epipolar  lines

Graph cuts: expansion moves

β€’ Assume is non-negative and is metric:

β€’ We can apply more semi-global moves using minimal s-t cuts

β€’ Converges faster to a better (local) minimum

Page 19: Epipolar  lines

Ξ±-Expansion

β€’ Expansion move allows in one shot each pixel to either change its state to Ξ± or to maintain its current state

β€’ We apply expansion moves for all possible disparity values and repeat this to convergence

β€’ At convergence energy is within a scale factor from the global optimum:

where

Page 20: Epipolar  lines

Ξ±-Expansion (1D example)

Page 21: Epipolar  lines

Ξ±-Expansion (1D example)

𝛼

𝛼  

Page 22: Epipolar  lines

Ξ±-Expansion (1D example)

𝛼

𝛼  

Page 23: Epipolar  lines

Ξ±-Expansion (1D example)

𝐷𝑝(𝛼) π·π‘ž (𝛼)

𝛼

𝛼  

𝑉 π‘π‘ž (𝛼 ,𝛼 )=0

Page 24: Epipolar  lines

Ξ±-Expansion (1D example)

𝛼

𝛼  π·π‘(𝑑𝑝) π·π‘ž (π‘‘π‘ž)

But what about?

Page 25: Epipolar  lines

Ξ±-Expansion (1D example)

𝛼

𝛼  π·π‘(𝑑𝑝) π·π‘ž (π‘‘π‘ž)

𝑉 π‘π‘ž(𝑑𝑝 ,π‘‘π‘ž)

Page 26: Epipolar  lines

Ξ±-Expansion (1D example)

𝛼

𝛼  π·π‘(𝑑𝑝)

𝑉 π‘π‘ž(𝑑𝑝 ,𝛼)π·π‘ž (𝛼)

Page 27: Epipolar  lines

Ξ±-Expansion (1D example)

𝛼

𝛼  π·π‘ž (π‘‘π‘ž)

𝑉 π‘π‘ž(𝛼 ,π‘‘π‘ž)𝐷𝑝(𝛼)

Page 28: Epipolar  lines

Ξ±-Expansion (1D example)

𝛼

𝛼  

𝑉 π‘π‘ž(𝛼 ,π‘‘π‘ž)𝑉 π‘π‘ž(𝑑𝑝 ,𝛼)

𝑉 π‘π‘ž(𝑑𝑝 ,π‘‘π‘ž)

Such a cut cannot be obtained due to triangle inequality:

Page 29: Epipolar  lines

Common Metrics

β€’ Potts model:

β€’ Truncated :

β€’ Truncated squared difference is not a metric

Page 30: Epipolar  lines

Reconstruction with graph-cuts

Original Result Ground truth


Top Related