Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

16
Image Rectification Image Rectification for Stereo Vision for Stereo Vision Charles Loop Charles Loop Zhengyou Zhang Zhengyou Zhang Microsoft Research Microsoft Research

Transcript of Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Page 1: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Image Rectification Image Rectification for Stereo Visionfor Stereo Vision

Charles LoopCharles Loop

Zhengyou ZhangZhengyou Zhang

Microsoft ResearchMicrosoft Research

Page 2: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Problem Statement

Compute a pair of 2D projective transforms Compute a pair of 2D projective transforms ((homographieshomographies))

Original images Rectified images

Page 3: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Motivations To simplify stereo matching:To simplify stereo matching:

Instead of comparing pixels on Instead of comparing pixels on skew linesskew lines, we now only compare , we now only compare pixels on pixels on the same scan linesthe same scan lines..

Graphics applications: view morphingGraphics applications: view morphing Problem:Problem:

Rectifying homographies are not uniqueRectifying homographies are not unique Goal: Goal: to develop a technique based onto develop a technique based on

geometrically well-defined criteriageometrically well-defined criteria minimizing minimizing image distortion due to rectificationimage distortion due to rectification

Page 4: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Epipolar Geometry

M

C

C’

m

m’

•Epipoles anywhere•Fundamental matrix F: a 3x3 rank-2 matrix

•Epipole at•Fundamental matrix

T001i

010

100

000

][iF

Page 5: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Stereo Image Rectification

Compute Compute H H and and H’ H’ such thatsuch that Compute rectified image points:Compute rectified image points:

Problem:Problem:

H H and and H’ are not unique.H’ are not unique.

Page 6: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Properties of H and H’ (I) Consider each row of Consider each row of H H and and H’ as a line:H’ as a line:

Recall: Recall: bothboth e e andand e’ e’ are sent toare sent to [1 0 0] [1 0 0]TT

Observations (I):Observations (I): v v andand w w must go through the epipolemust go through the epipole e e v’ v’ andand w’ w’ must go through the epipolemust go through the epipole e’ e’ u u and and u’u’ are irrelevant to rectification are irrelevant to rectification

Page 7: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Properties of H and H’ (II) Observation (II):Observation (II):

Lines Lines vv and and v’v’, and lines , and lines ww and and w’w’ must be corresponding epipolar lines. must be corresponding epipolar lines.

Observation (III):Observation (III):

Lines Lines ww and and w’w’ define the rectifying plane. define the rectifying plane.

Page 8: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Decomposition of H

Special projective transform:Special projective transform:

Similarity transform:Similarity transform:

Shearing transform:Shearing transform:

prs HHHH

Page 9: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Special Projective Transform (I)

Sends the epipole to infinitySends the epipole to infinity epipolar lines become parallel epipolar lines become parallel Captures all image distortion due to Captures all image distortion due to

projective transformationprojective transformation Subgoal: Subgoal: Make Make HHp p as affine as possible.as affine as possible.

Page 10: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Special Projective Transform (II)

How to do it?How to do it? Let original image point beLet original image point be the transformed point will bethe transformed point will be

Observation: Observation:

If all weights are equal, then there is no distortion.If all weights are equal, then there is no distortion.

Key ideaKey idea::

minimize the variation of minimize the variation of wwii over all pixels over all pixels

with weight

Page 11: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Similarity Transform

Rotate and translate images such that the Rotate and translate images such that the epipolar lines are horizontally aligned.epipolar lines are horizontally aligned.

Images are now rectified.Images are now rectified.

Page 12: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Shearing Transform

Free to scale and translate in the horizontal Free to scale and translate in the horizontal direction.direction.

Subgoal:Subgoal:

Preserve original image resolution as close Preserve original image resolution as close as possible.as possible.

Page 13: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Example

Original image pairOriginal image pair

Page 14: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Intermediate result After special projective transform:After special projective transform:

Page 15: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Intermediate result After similarity transform:After similarity transform:

Page 16: Image Rectification for Stereo Vision Charles Loop Zhengyou Zhang Microsoft Research.

Final result After shearing transformAfter shearing transform