資料來源:Robert Collins,CSE486, Penn State第8講Stereo Vision
深度信息感知是人類產(chǎn)生立體視覺的前提。生理過程一定是相當(dāng)復(fù)雜,此處,我們只從物理角度,并采用數(shù)學(xué)的方法來討論。
Inferring depth from images taken at the same time by two or more cameras.
基本透視投影
透視投影是多對一的關(guān)系,投影線上的任何一點(diǎn)對應(yīng)同一個像點(diǎn)。
如果用兩個攝像機(jī),則可以消除這種多對一,從而能夠確定第三維坐標(biāo)Z的值,即深度信息。
為什么可以感知深度信息呢?我們的左右眼從略微不同的角度觀察景物,而這種視差與物體所處的位置有關(guān)。
重要的概念之一:視差(Parallax)
自己可以體驗(yàn)一下:將手指頭放在離眼睛不同距離的位置,并輪換睜、閉左右眼,可以發(fā)現(xiàn)手指在不同距離的位置,視覺差也不同,且距離越近,視差越大。
重要概念之二: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 andcyan. 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.
這種立體照片的原理是利用特殊的眼鏡,使左右眼接收不同顏色的光線,通過大腦合成立體照片。
關(guān)于深度信息的感知理論還在發(fā)展中,這是一個復(fù)雜的過程,很難用單一的理論來完全描述,決定深度信息感覺的因素很多。如消失線,同類物體的大小,遮擋關(guān)系等等。甚至,用單眼也可以感知深度信息。
下面著重借助幾何和代數(shù)的方法來描述立體感知。先從簡單的情況開始......
假設(shè)兩個相機(jī)的內(nèi)部參數(shù)一致,如焦距、鏡頭等等,為了數(shù)學(xué)描述的方便,需引入坐標(biāo),由于坐標(biāo)是人為引入的,因此客觀世界中的事物可以處于不同的坐標(biāo)系中。假設(shè)兩個相機(jī)的X軸方向一致,像平面重疊,如下圖所示,坐標(biāo)系以左相機(jī)為準(zhǔn),右相機(jī)相對于左相機(jī)是簡單的平移,用坐標(biāo)表示為(Tx,0,0)
Tx一般稱為基線(baseline),根據(jù)三角形相似關(guān)系,很容易得出空間中的一點(diǎn)P(X,Y,Z)分別在左右像平面上的投影坐標(biāo)。
因此,左相機(jī)像平面像點(diǎn)的坐標(biāo)為
xl=fXZ
yl=fYZ
右相機(jī)平面像點(diǎn)的坐標(biāo)為
xr=fX?TxZ
yr=fYZ
顯然,深度信息Z和視差(Disparity / Parallax) d
成反比,這與我們用手指做試驗(yàn)是相吻合的,這也是為什么近的物體看起來比遠(yuǎn)的物體移動得快。
image