300 likes | 628 Views
비전기반 HRI. Stereo Vision & Rectification Ref. Multiple View Geometry in CV Chap.9, Chap 11. Why Stereo Vision?. 2D images project 3D points into 2D 3D points on the same viewing line have the same 2D image 2D imaging results in depth information loss. P. Q. P’=Q’. O.
E N D
비전기반 HRI Stereo Vision & Rectification Ref. Multiple View Geometry in CV Chap.9, Chap 11
Why Stereo Vision? • 2D images project 3D points into 2D • 3D points on the same viewing line have the same 2D image • 2D imaging results in depth information loss P Q P’=Q’ O center of projection
Z f L xl Pl b f R xr Pr x - b P depth X (x, z) disparity Canonical Stereo Configuration • Stereo System “Disparity” refers to difference in the image location of the same 3D point when projection under perspective to two different cameras
depth map 3D rendering [Szeliski & Kang ‘95] X z x x’ f f baseline C C’ Depth from disparity input image (1 of 2)
Stereo reconstruction pipeline • Steps • Calibrate cameras • Rectify images • Compute disparity • Estimate depth • What will cause errors? • Camera calibration errors • Poor image resolution • Occlusions • Violations of brightness constancy (specular reflections) • Large motions • Low-contrast image regions
Stereo Matching For each scanline , for each pixel in the left image • compare with every pixel on same epipolar line in right image • pick pixel with minimum match cost • This will never work, so: improvement match windows
? = g f Most popular Stereo Matching Comparing Windows: For each window, match to closest window on epipolar line in other image.
Stereo Matching Minimize Sum of Squared Differences Cross correlation Maximize It is closely related to the SSD:
Region based Similarity Metrics • Sum of squared differences • Normalize cross-correlation • Sum of absolute differences
NCC score for two widely separated views NCC score
W = 3 W = 20 Window size • Effect of window size • Better results with adaptive window • T. Kanade and M. Okutomi,A Stereo Matching Algorithm with an Adaptive Window: Theory and Experiment,, Proc. International Conference on Robotics and Automation, 1991. • D. Scharstein and R. Szeliski. Stereo matching with nonlinear diffusion. International Journal of Computer Vision, 28(2):155-174, July 1998
Stereo results • Data from University of Tsukuba Scene Ground truth
Results with window correlation Window-based matching (best window size) Groundtruth
Results with better method Graph Cuts Ground truth • Boykov et al., Fast Approximate Energy Minimization via Graph Cuts, • International Conference on Computer Vision, September 1999.
More of advanced stereo • Ordering constraint • Dynamic programming • Global optimization
Image Rectification • Given general displacement how to warp the views • Such that epipolar lines are parallel to each other • How to warp it back to canonical configuration 16
EpipolarRectification • Epipolar Geometry • Rectification • Image reprojectionreproject • image planes onto common plane parallel to line between optical centers • Applying HomograpiesH, H’ to map epipole e, e’ to[ 1 0 0 ]T, respectively 17
1. Map the epipole to infinity Translate the image center to the origin Rotate around z-axis for the epipole lie on the x-axis Transform the epipole from x-axis to infinity 2. Find a matching transformation is compatible with the epipolar geometry is chosen to minimize overall disparity EpipolarRectification • Make the epipolar lines parallel • Dense correspondences along image scanlines • Computation of warping homographies 18
e2 x o y x0 x y o x0 Epipolar Rectification • Map the epipole e2 to infinity • : Translate x0 to center of rotation(image center) • : Rotate e2 to x-axis e2 Line: x0 x e2 19
Epipolar Rectification • Map the epipole e2 to infinity • : Map (f, 0, 1) to infinity (f, 0, 0) • Characteristic of G
Hartley’sRectification Method • Matching transformation • H chosen so as to minimize the sum-of-squared distance • To minimize disparity • Form of H( is arbitrary vector)
Projective transformationParallelize corresponding epipolar lines • Similarity transformation match corresponding epipolarlines • Shearing transformation reduce horizontal directional • distortion Zhang’sRectification Method • Zhang의 방법 • Choose to minimize distortion • are factorized and Original Image pair Result of applying Result of applying Result of applying
EpipolarRectification Rectified Image Pair 25
EpipolarRectification Rectified Image Pair
Polar rectification (Pollefeys et al. ICCV’99) Polar re-parameterization around epipoles Requires only (oriented) epipolar geometry Preserve length of epipolar lines Choose so that no pixels are compressed original image rectified image Works for all relative motions Guarantees minimal image size
Example: Béguinage of Leuven Does not work with standard Homography-based approaches