スライド 1 - 和歌山大学

視覚の幾何学3
呉海元@和歌山大学
参考書
佐藤 淳:
「コンピュータビジョン -視覚の幾何学-」
コロナ社
2眼視の幾何: Two-View Geometry
x3
x2
x’3
x1
x’2
x’1
courtesy of F. Dellaert
画像間の点(xi to x’i )の対応関係は
・カメラ間の剛体変換(カメラ行列)
・シーンの構造
により決定
特徴に基づいた立体視
x1
corner
fB
Z
x1  x2
x2
2枚の画像から
3次元情報を復元
差(disparity)
立体視の原理
P



カメラキャリブレーション済みなら
光軸は平行になるように変換
(R,tが既知)
2D⇒3D
p
Yl
Pl
p
l
Xl
Zl
X’l
Ol
問題:
対応点の探索をどう絞るか?
Pr
Yr
Zr
t
Xl’ = T,
r
Or
R, t
Yl’ = Xl’xZl,
Xr
Z’l = Xl’xYl’
エピボラ幾何(Epipolar geometry)
複数の視点における相対的なカメラの位置や姿勢の情報を
エピポーラ幾何(Epipolar geometry)と呼ばれる画像特
有の幾何によって記述できる
O
カメラ間の剛体変換(カメラ行列)
O’
エピボラ幾何(Epipolar Geometry)

Baseline: カメラ中心C, C’を繋がる直線

Epipolar plane p: baselineとシーンの中の点 Xより
決定された平面
エピボラ平面
baseline
from Hartley
& Zisserman
エピボラライン(Epipolar Lines)


Epipolar lines l, l’: epipolar plane p と画像面
との交線
Epipoles e, e’: baselineと画像面との交点
エピボラ平面
Epipolar line
エピボラライン
C
Epipolar line
Epipole
エピホール
Epipole
C’
ベースライン
from Hartley
& Zisserman
Epipolar Pencil

X の位置を変化すると、epipolar planes はbaseline
の周りに“rotate”
• このような平面集合を epipolar pencilとよぶ

Epipolar lines はepipole から“radiate”
• これは pencil of epipolar lines
epipolar pencil
エピボラペンシール
pencil of epipolar line
from Hartley
& Zisserman
エピボラ制約(Epipolar Constraint)

エピボラ幾何より、片方の画像内の一点はかならずも
う一方の画像内のエピボラ直線(1D)上存在
x’
C
C’
from Hartley
& Zisserman
例:Epipolar Lines for Converging Cameras
Left view
epipolar linesの交線 = Epipole !
他方のカメラ中心の位置を表す
ロボット・カメラの移動軌跡の推定
Right view
from Hartley
& Zisserman
特例: Translation Parallel to Image Plane
カメラの運動が画像面と平行する場合、
・epipolar linesは平行
・対応点は対応 epipolar line上に存在 (全種類のカメラ運動)
特例: Translation along Optical Axis
カメラの運動が画像平面と垂直:


Epipolesはfocus延長線上に一致
一般的に、無限遠点と異なる
e’
e
ステレオから3眼視へ

エピボラ幾何より、片方の画像内の一点はかならずも
う一方の画像内のエピボラ直線(1D)上存在
対応付け:
左側の画像上の1点
右側の画像上の一本の直線
x’
C
C’
Transfer: epipolar transfer
点点
Using more cameras to remove match ambiguity
3眼視
透視カメラのエピポーラ幾何



複数のカメラの関係や対象物との関係を考えるた
めに、何か基準となる座標系を考えなければなら
ない(各のカメラのカメラ座標系を元に考えるので
はない)
すべてのカメラや対象物に対して共通に決められ
た座標のことをワールド座標(world coordinates)
と呼ぶ(ワールド座標を一つ決める)
ワールド座標を基準に考えなければならない
Coordinate Transformations
座標変換


If we want to measure something (size of an object,
depth of image points, distance between features……),
we need to understand the geometry from image to world
Coordinate system transformations
• Image (i) camera (c) world (w) object (o)
yc
yi
yw
zc
zw
xc
xi
xw
行列・ベクトルの外積
a2b3  a3b2   0
a  b   a3b1  a1b3    a3
 a1b2  a2b1   a2
a  (a  b)  0
b  (a  b)  0
 a3
0
a1
a2 
 a1 b 
0 
a b
幾何変換
Geometric transformation
P'  RP  t
p  KP with K  [ I | 0]
p'  K ' P with K '  [ R | t ]
基本行列 (Essential matrix)


⇒
2カメラ間の姿勢と位置:
• R : 3*3 rotation matrix
• t : 3*1 translation vector
pとp’が対応点同士なら:
 p  (u, v,1)T
p'[t  ( Rp)]  0 with 
T
 p'  (u ' , v' ,1)
前提: pとp’は画像座標から計算
された物理(カメラ)座標である
(カメラの内部パラメータ既知)
即ち:同一平面内の三つのベクトルから二つのベクトルの外積と
残るもう一つのベクトルの内積は0となる
エピボラ方程式
p' Ep  0
基本行列(E行列) with E  t R
★ Eが求まれば、tとRに分解することができる
基礎行列(Fundamental matrix)

内部パラメータが未知、画像座標xしか分からない
• 画像座標xと物理(カメラ)座標pの関係:
x=Kp , x’=K’p’ ⇒ p=K-1x, p’=K’-1x’
(K,K’ are the camera calibration matrix)

基本行列から : p’TEp=0
⇒ x’TK’-TEK-1x=0
⇒ x’TFx=0
F= K’-TEK-1 基礎行列 (F行列)
●基礎行列はカメラの内部パラメータと外部パラメー
タの双方を含んでいる
基礎行列Fの性質
x’TFx=0
 x=eの場合 (e is epipole) : x’TFe=0,∀x’
(∵全てのepipolar linesはepipoleの所に交叉)
⇒ Fe = 0
 x’=e’の場合(e’ is epipole) : e’TFx =0,∀x
⇒ e’TF = 0 ⇒ FTe’ = 0

●F行列が与えられれば、eとe’はそれぞれFTFと
FFTの最も小さい固有値に対応する固有ベクト
ルとして求められる
The Fundamental Matrix F

片方の画像内の点xがもう一方の画像内epipolar
line l’ 上に対応付けることは:
line
point
l’ = Fx

このpoint-on-lineの関係は l’TFx
れ、l’T Fx
= 0より決定さ
= (Fx)T l’ = 0の関係も成り立つ
 F is 3 x 3, rank 2 (逆行列が求められない)
Homography
空間中の対象点がすべてある平面内の上にある場合
Homography
空間中の対象点がすべてある平面内の上にある場合

x’=Hx 空間内平面と画像間の投影
ximage  ox   f x
yimage  oy   f y

r1,1 X world  r1, 2Yworld  r1,3 Z world  t x
r3,1 X world  r3, 2Yworld  r3,3 Z world  t z
r2,1 X world  r2, 2Yworld  r2,3 Z world  t y
r3,1 X world  r3, 2Yworld  r3,3 Z world  t z
ホモグラフィ行列Hの自由度: 8
特例として
Z world  0
Compute H

一対の対応点 ((x,y,1)⇔(x’,y’,1))が分かれば、二つ
の方程式が得られる
x'1 h11 x  h12 y  h13
x' 

x'3 h31 x  h32 y  h33
x'2 h21 x  h22 y  h23
y' 

x'3 h31 x  h32 y  h33
x' h31 x  h32 y  h33   h11 x  h12 y  h13
y' h31 x  h32 y  h33   h21 x  h22 y  h23

(linear in hij)
4組み以上の対応点(n>=4)が分かれば、Hが唯一
に決定できる
Applying Homographies to Removing
projective distortion
select four points in a plane with know coordinates
x' 
x'1 h11 x  h12 y  h13

x'3 h31 x  h32 y  h33
y' 
x'2 h21 x  h22 y  h23

x'3 h31 x  h32 y  h33
x' h31 x  h32 y  h33   h11 x  h12 y  h13
(linear in hij)
y' h31 x  h32 y  h33   h21 x  h22 y  h23
Homographies for
Bird’s-eye Views
from Hartley & Zisserman
Homography between images of planes



x=H1xπ , x’=H2xπ
x’=H2xπ=H2H1-1x=Hx
4組み以上の対応点(n>=4)が分かれば、Hが唯一に
決定できる
Homographies for Mosaicing
from Hartley & Zisserman
Stereo
Wider Baseline
Multi-Camera Stereo
Stereo
Multi-Camera Stereo