發表文章

目前顯示的是 7月 8, 2018的文章

Matchmoving related issues

圖片
1. Feature tracking: Harris + KLT (一般常用的組合),  SIFT (比較穩,但計算時間也較長) , Controlled environment (可確保特徵點匹配準確) Challenges: Removing false corners (需濾掉匹配錯誤的特徵點), assuming stationary background (物體靜止較方便相機姿態估算), deleting short tracks (盡量用會一直出現的特徵點), growing matches (盡可能增加穩健特徵點數量). 2. Essential matrix: 當已知相機參數時,Fundamental matrix可簡化為Essential matrix。對Essential matrix進行SVD分解可進一步求得兩相機座標系統之間的R和T (假設兩張圖由不同位置之相機所拍攝)。 解法參:   淺談基礎矩陣,本質矩陣與相機移動 3. Singular value decomposition (SVD): 用於解一個非對稱矩陣的eigenvalues, eigenvectors. 4. Triangulation: 探討當已知兩張從不同角度拍攝的物體影像,如何建構出3D物體資訊。 理論上: 簡單數學幾何關係即可找出物體在3D中的位置 實際上: 兩個相機不會剛好平行 需要在影像上找到確定地相對特徵點 解決方法: 相機事先校正 在epipolar line上找對應特徵點 (Sum of Squared Differences (SSD) algorithm, Energy minimization algorithm) Image rectification使相對應特徵點平行 OpenCV function: trinagulatePoints (參:  triangulate 3d points from a stereo camera and chessboard. ) 實際雙眼視覺reconstruction流程: Calibrate cameras (得到相機參數) Rectify images (對齊特徵點) Compute disparity

Epipolar Geometry

圖片
1. Epipolar Geometry Two images taken at the same time, in different positions, by different cameras. Don't need to search across the entire image to estimate the motion vector Only one degree of freedom for the possible correspondence 假設有兩張連續拍攝的影像 I1, I2 ,則物體 P 在 I2 上的成像點必落在一條線上,稱之為Epipolar line(因為不知道P與 I1 的距離),而 I2 上所有的 Epipolar line會相交在一點,稱之為epipole。 2. The fundamental matrix 在 I1及 I2 上相對應的特徵點,滿足: which is: We can build an linear system with n corresponding feature points located on two images: 找到最佳解f即為Fundamental matrix。 Basic algorithm: normalized 8-points algorithm 重要觀念: Normalized特徵點。 雖然無法找到唯一解使得Af = 0,但可對A做SVD特異值分解,D之中最小eigenvalue對應的eigenvector即為使Af最小的向量。(Af = 0 => Af = λf = 0, satisfied when λ=0 ) 到Step4算出來的F可能不是Rank2,所以需要再做一次SVD,令D之中最小eigenvalue為0,使F變為Rank2。 RANSAC可用來濾掉outliers。 Image rectification可用來對齊兩張影像的epipolar line,方便我們搜尋特徵點。(homography transformation) 參: Hartley.