資料來源:Robert Collins,CSE486, Penn State第8講
Stereo Vision
深度信息感知是人類產生立體視覺的前提。生理過程一定是相當複雜,此處,我們只從物理角度,並採用數學的方法來討論。
Inferring depth from images taken at the same time by two or more cameras.
基本透視投影
透視投影是多對一的關係,投影線上的任何一點對應同一個像點。
如果用兩個攝像機,則可以消除這種多對一,從而能夠確定第三維座標Z的值,即深度信息。
爲什麼可以感知深度信息呢?我們的左右眼從略微不同的角度觀察景物,而這種視差與物體所處的位置有關。
重要的概念之一:視差(Parallax)
自己可以體驗一下:將手指頭放在離眼睛不同距離的位置,並輪換睜、閉左右眼,可以發現手指在不同距離的位置,視覺差也不同,且距離越近,視差越大。
重要概念之二:Anaglyph image(來自wiki)
Anaglyph images are used to provide a stereoscopic 3D effect, when viewed with glasses where the two lenses are different (usually chromatically opposite) colors, such as red and cyan. Images are made up of two color layers, superimposed, but offset with respect to each other to produce a depth effect. Usually the main subject is in the center, while the foreground and background are shifted laterally in opposite directions. The picture contains two differently filtered colored images, one for each eye. When viewed through the "color coded" "anaglyph glasses", they reveal an integrated stereoscopic image. The visual cortexof the brain fuses this into perception of a three dimensional scene or composition.
這種立體照片的原理是利用特殊的眼鏡,使左右眼接收不同顏色的光線,通過大腦合成立體照片。
關於深度信息的感知理論還在發展中,這是一個複雜的過程,很難用單一的理論來完全描述,決定深度信息感覺的因素很多。如消失線,同類物體的大小,遮擋關係等等。甚至,用單眼也可以感知深度信息。
下面着重藉助幾何和代數的方法來描述立體感知。先從簡單的情況開始......
假設兩個相機的內部參數一致,如焦距、鏡頭等等,爲了數學描述的方便,需引入座標,由於座標是人爲引入的,因此客觀世界中的事物可以處於不同的座標系中。假設兩個相機的X軸方向一致,像平面重疊,如下圖所示,座標系以左相機爲準,右相機相對於左相機是簡單的平移,用座標表示爲(Tx,0,0)
Tx一般稱爲基線(baseline),根據三角形相似關係,很容易得出空間中的一點P(X,Y,Z)分別在左右像平面上的投影座標。
因此,左相機像平面像點的座標爲
xl=fXZ yl=fYZ
右相機平面像點的座標爲
xr=fX−TxZ yr=fYZ
顯然,深度信息Z和視差(Disparity / Parallax) d成反比,這與我們用手指做試驗是相吻合的,這也是爲什麼近的物體看起來比遠的物體移動得快。
轉自:http://www.cnblogs.com/gemstone/articles/2293806.html