Download - Epipolar lines
Epipolar lines
epipolar linesepipolar lines
BaselineO Oβ
epipolar plane
π β²π πΈπ=0
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
Rectification
BaselineO Oβ
π β²ππ» πβπ πΈπ»π
β1π=0
π» π π»π
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:
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)
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)
Moving random dots
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
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)
String matchingβ’ Swing β String
S t r i n g
S w i n g
Start
End
String matchingβ’ Cost: #substitutions + #insertions + #deletions
S t r i n g
S w i n g
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
Dynamic Programming
Start
, Complexity?
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
Markov Random Field
β’ Graph β’ In our case: graph is
a 4-connected grid
β’ Minimize energy of the form
β’ Interpreted as negative log probabilities
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
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
Ξ±-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
Ξ±-Expansion (1D example)
Ξ±-Expansion (1D example)
πΌ
πΌ
Ξ±-Expansion (1D example)
πΌ
πΌ
Ξ±-Expansion (1D example)
π·π(πΌ) π·π (πΌ)
πΌ
πΌ
π ππ (πΌ ,πΌ )=0
Ξ±-Expansion (1D example)
πΌ
πΌ π·π(ππ) π·π (ππ)
But what about?
Ξ±-Expansion (1D example)
πΌ
πΌ π·π(ππ) π·π (ππ)
π ππ(ππ ,ππ)
Ξ±-Expansion (1D example)
πΌ
πΌ π·π(ππ)
π ππ(ππ ,πΌ)π·π (πΌ)
Ξ±-Expansion (1D example)
πΌ
πΌ π·π (ππ)
π ππ(πΌ ,ππ)π·π(πΌ)
Ξ±-Expansion (1D example)
πΌ
πΌ
π ππ(πΌ ,ππ)π ππ(ππ ,πΌ)
π ππ(ππ ,ππ)
Such a cut cannot be obtained due to triangle inequality:
Common Metrics
β’ Potts model:
β’ Truncated :
β’ Truncated squared difference is not a metric
Reconstruction with graph-cuts
Original Result Ground truth