cs654: digital image analysis lecture 8: stereo imaging

23
CS654: Digital Image Analysis Lecture 8: Stereo Imaging

Upload: cody-kelly

Post on 01-Jan-2016

231 views

Category:

Documents


2 download

TRANSCRIPT

CS654: Digital Image Analysis

Lecture 8: Stereo Imaging

Recap of Lecture 7

โ€ข Inverse perspective transformation and its issues

โ€ขMany to one mapping

โ€ข Generalized perspective transformation

โ€ข Fundamentals of camera calibration

Outline of Lecture 8

โ€ข Fundamentals of stereo imaging

โ€ข Calculation of disparity

โ€ข Search space for point correspondence

โ€ข Correlation based correspondence

Camera calibration

๐‘11 ๐‘‹+๐‘12๐‘Œ+๐‘13๐‘+๐‘14โˆ’๐‘ฅ๐‘‹ ๐‘41โˆ’๐‘ฅ๐‘Œ ๐‘42โˆ’๐‘ฅ๐‘๐‘43โˆ’๐‘ฅ ๐‘44=0

๐‘21๐‘‹+๐‘22๐‘Œ +๐‘23 ๐‘+๐‘24โˆ’ ๐‘ฆ ๐‘‹ ๐‘41โˆ’ ๐‘ฆ ๐‘Œ ๐‘42โˆ’ ๐‘ฆ ๐‘๐‘43โˆ’๐‘ฆ ๐‘44=0

โ€ฆ.. (1)

โ€ฆ.. (2)6 pairs of points are required

and

and

and

and

and

and

Solving for unknowns

๐ถ๐‘ƒ=0

[๐‘‹1 ๐‘Œ 1 ๐‘1 1 0 0 0 0 โˆ’๐‘ฅ1 ๐‘‹1 โˆ’๐‘ฅ1๐‘Œ 1 โˆ’๐‘ฅ1๐‘ 1 โˆ’๐‘ฅ1๐‘‹ 2 ๐‘Œ 2 ๐‘2 1 0 0 0 0 โˆ’๐‘ฅ2 ๐‘‹ 2 โˆ’๐‘ฅ2๐‘Œ 2 โˆ’๐‘ฅ2๐‘ 2 โˆ’๐‘ฅ2โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ๐‘‹ 6 ๐‘Œ 6 ๐‘6 1 0 0 0 0 โˆ’๐‘ฅ6 ๐‘‹ 6 โˆ’๐‘ฅ6๐‘Œ 6 โˆ’ ๐‘ฅ6๐‘ 6 โˆ’ ๐‘ฅ60 0 0 0 ๐‘‹1 ๐‘Œ 1 ๐‘1 1 โˆ’ ๐‘ฆ1๐‘‹ 1 โˆ’ ๐‘ฆ1๐‘Œ1 โˆ’ ๐‘ฆ1๐‘1 โˆ’ ๐‘ฆ10 0 0 0 ๐‘‹ 2 ๐‘Œ 2 ๐‘2 1 โˆ’ ๐‘ฆ2๐‘‹ 2 โˆ’ ๐‘ฆ2๐‘Œ2 โˆ’ ๐‘ฆ2๐‘2 โˆ’ ๐‘ฆ2โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ0 0 0 0 ๐‘‹ 6 ๐‘Œ 6 ๐‘6 1 โˆ’ ๐‘ฆ 6๐‘‹ 6 โˆ’๐‘ฆ 6๐‘Œ6 โˆ’ ๐‘ฆ6๐‘6 โˆ’ ๐‘ฆ6

] [๐‘Ž11๐‘Ž12๐‘Ž13๐‘Ž14๐‘Ž21๐‘Ž22๐‘Ž23๐‘Ž24๐‘Ž41๐‘Ž42๐‘Ž43๐‘Ž44

]=[0โ‹ฎ000โ‹ฎ0]

2๐‘›ร—1212ร—1

12ร—1

Perspective transformation

P

PI

๐‘ , ๐‘ง

๐‘Œ , ๐‘ฆ

๐‘‹ ,๐‘ฅ

World co-ordinate

Image plane

๐‘ฅ=๐œ†๐‘‹๐œ†โˆ’๐‘ ๐‘ฆ=

๐œ†๐‘Œ๐œ†โˆ’๐‘

๐‘‹=๐‘ฅ๐œ†

(๐œ†โˆ’๐‘ ) ๐‘Œ=๐‘ฆ๐œ†

(๐œ†โˆ’๐‘ )Two equations, three unknowns

Stereo geometry

Image courtesy: https://en.wikipedia.org/wiki/Epipolar_geometry

Introducing a second imaging plane

๐‘ƒ :(๐‘‹ ,๐‘Œ ,๐‘ )

๐‘ง

๐‘ƒ ๐ผ โ€ฒ๐‘ฆ

๐‘ฅ

๐‘ง โ€ฒ

๐‘ฆ โ€ฒ

๐‘ฅ โ€ฒ

Focal length of C1

Coordinate system for C1Image point w.r.to C1

Coordinate system for C2Image point w.r.to C2

Focal length of C2

Relationship between coordinate systems

[๐‘ฅ โ€ฒ๐‘ฆ โ€ฒ๐‘ง โ€ฒ ]=[๐‘Ÿ11 ๐‘Ÿ 12 ๐‘Ÿ13๐‘Ÿ 14 ๐‘Ÿ 15 ๐‘Ÿ16๐‘Ÿ 17 ๐‘Ÿ 18 ๐‘Ÿ19 ] [

๐‘ฅ๐‘ฆ๐‘ง ]+[๐‘ก๐‘ฅ๐‘ก๐‘ฆ๐‘ก ๐‘ง ]

Coordinates of Camera #2

Rotation matrix

Translation matrix

Coordinates of Camera #1

Assumptions

โ€ขWorld coordinate w.r.to camera #1:

โ€ขWorld coordinate w.r.to camera #2:

โ€ข Two cameras are having identical focal length:

โ€ข Coordinate of the point w.r.to x-y-z coordinate system

โ€ข Coordinate of the point w.r.to xโ€™-yโ€™-zโ€™ coordinate system

Mathematical relationship between points

โ€ข For camera #1

โ€ข For camera #2

๐‘ฅ0๐‘ฅ ๐‘–

=๐‘ฆ 0๐‘ฆ ๐‘–

=๐œ†โˆ’ ๐‘ง0๐œ†

๐‘ฅ0 โ€ฒ๐‘ฅ ๐‘– โ€ฒ

=๐‘ฆ0 โ€ฒ๐‘ฆ ๐‘–โ€ฒ

=๐œ†โˆ’๐‘ง 0 โ€ฒ๐œ†

Coordinate transformation is required

Rectified camera configuration

โ€ข Assume pure translation, without any rotation

[๐‘ฅ โ€ฒ๐‘ฆ โ€ฒ๐‘ง โ€ฒ ]=[1 0 00 1 00 0 1 ][

๐‘ฅ๐‘ฆ๐‘ง ]+[๐›ฟ๐‘ฅ00 ]

[๐‘ฅ โ€ฒ๐‘ฆ โ€ฒ๐‘ง โ€ฒ ]=[1 0 00 1 00 0 1 ][

๐‘ฅ๐‘ฆ๐‘ง ]+[ 0๐›ฟ ๐‘ฆ0 ]

[๐‘ฅ โ€ฒ๐‘ฆ โ€ฒ๐‘ง โ€ฒ ]=[1 0 00 1 00 0 1 ][

๐‘ฅ๐‘ฆ๐‘ง ]+[ 00๐›ฟ๐‘ง ]

Lateral stereo geometry

Axial stereo geometry

Modified camera configuration after lateral shift along x-axis

LEFT

๐‘ง

๐‘ฅ

๐‘ฆ

๐€๐‘‚ ๐ฟ

๐ถ๐ฟ

๐‘ง โ€ฒ

๐‘ฅ โ€ฒ

๐‘ฆ โ€ฒ

๐€๐‘‚๐‘…

๐ถ๐‘…

RIGHT

๐›ฟ๐‘ฅ

๐‘ƒ (๐‘ฅ0 , ๐‘ฆ0 ,๐‘ง 0)

๐‘ƒ ๐ฟ(๐‘ฅ๐ฟ , ๐‘ฆ๐ฟ) ๐‘ƒ ๐‘…(๐‘ฅ๐‘… , ๐‘ฆ๐‘…)

Assumption

โ€ข : w.r.to x-y-z coordinate system

โ€ข : w.r.to x-y-z coordinate system

โ€ข : Origin of the left camera coordinate system

โ€ข : Origin of the right camera coordinate system

โ€ขWorld coordinate w.r.to left camera is

โ€ข : Lateral shift between to cameras

Mathematical relationship

โ€ข For camera #1

โ€ข For camera #2

๐‘ฅ0๐‘ฅ ๐ฟ

=๐‘ฆ0๐‘ฆ ๐ฟ

=๐œ†โˆ’ ๐‘ง0๐œ†

๐‘ฅ0๐‘ฅ๐‘…

=๐‘ฆ0๐‘ฆ๐‘…

=๐œ†โˆ’๐‘ง 0๐œ†

๐‘ฅ0+๐›ฟ๐‘ฅ๐‘ฅ๐‘…+๐›ฟ๐‘ฅ

=๐‘ฆ 0๐‘ฆ๐‘…

=๐œ†โˆ’๐‘ง 0๐œ†

Incorrect

Solve for unknowns

๐‘ฅ0๐‘ฅ ๐ฟ

=๐œ†โˆ’๐‘ง 0๐œ†

โ€ฆโ€ฆ.. (1)

๐‘ฆ0๐‘ฆ ๐ฟ

=๐œ†โˆ’๐‘ง 0๐œ†

โ€ฆโ€ฆ.. (2)

๐‘ฅ0+๐›ฟ๐‘ฅ๐‘ฅ๐‘…+๐›ฟ๐‘ฅ

=๐œ†โˆ’๐‘ง0๐œ†

โ€ฆโ€ฆ.. (3)

๐‘ฆ 0๐‘ฆ๐‘…

=๐œ†โˆ’๐‘ง 0๐œ†

โ€ฆโ€ฆ.. (4)

Coordinate of the 3D world point

๐‘ง 0=๐œ†+๐›ฟ๐‘ฅ .๐œ†

๐‘ฅ๐ฟโˆ’(๐‘ฅ๐‘…+๐›ฟ๐‘ฅ)

๐‘ฅ0=๐›ฟ๐‘ฅ .๐œ† . ๐‘ฅ๐ฟ

๐‘ฅ๐ฟโˆ’(๐‘ฅ๐‘…+๐›ฟ๐‘ฅ)

๐‘ฆ 0=๐›ฟ ๐‘ฅ .๐œ† . ๐‘ฆ ๐ฟ

๐‘ฅ๐ฟโˆ’(๐‘ฅ๐‘…+๐›ฟ๐‘ฅ )

Depth

Disparity

โ€ข Denominator term is significant

โ€ข Translating the point to the left camera plane

โ€ข Relative displacement: disparity

โ€ข Object at infinity

โ€ข Depth is inversely related to the disparity

Search space for stereo matching

Left Right

N

N

N

N

๐‘ฆ0๐‘ฆ ๐ฟ

=๐œ†โˆ’๐‘ง 0๐œ†

๐‘ฆ 0๐‘ฆ๐‘…

=๐œ†โˆ’๐‘ง 0๐œ†

Token Based Stereo

โ€ข Detect tokenโ€ข Corners, interest point, edges

โ€ข Find correspondences

โ€ข Interpolate surface

Correlation Based Stereo Methods

โ€ข Depth is computed only at tokens and interpolated/ extrapolated to remaining pixel

โ€ข Disparity map is constructed based on a correlation measure

|| 1 tt IIAD

tt II 1CC

tt

tt

II

II

.

.1NC

2

1 tt IISSD

Correlation Based Stereo Methods

โ€ข Once disparity is available compute depth using

๐‘=๐œ†๐ต๐‘‘ Separation between the cameras disparity

Error

Index of points

Thank youNext Lecture: Image Interpolation