問題描述
在多視圖幾何中最接近另一個 3D 點的線上查找 3D 點? (To find 3D point on a line closest to another 3D point in Multi‑view Geometry?)
我有兩個立體相機,我從左相機和右相機都捕獲了標記的圖像。
我有一個完美的校準
- 內在 li>
- 失真校正
- 外部
現在來到標記,我在板上有一組標記,我估計了它的姿勢。此外,我根據三角 3D 點計算了每個標記的 3D 點
cv::triangulatePoints(Projection_Matrix_L[o], Projection_Matrix_R[o], pointsMat1, pointsMat2, pnts3D);
然後我知道相機中心(CL_O)
CL_O = ‑Rotation_matrix.inv * translation
主要是(0,0,0 )
對於其他相機視圖也類似。為簡單起見,我們只使用一個。
我假設下面的等式應該根據 lambda(λ) 計算直線中的點
line(λ) = CL_O + λ*t
CL_O, is a 3D point say (x0, y0, z0)
t, is a Vector (a, b, c)
使用正確的(λ)值,結果將是一個3D點,比如Q。但它仍然不靠近標記點P。所以我需要計算點P和Q之間的最小距離。
問題 ‑ 我應該如何確定每個 3D 標記點的 λ,以便它給我一個接近 P 且誤差最小的 3D 點 Q。不知道下面的公式是否正確?
f(λ) = abs(Point P ‑ line(λ))
如果您認為它是正確的,我需要示例代碼/偽代碼的幫助來實現它(最好是 C++ 或 python)。
雖然上面寫了,我還是覺得還是少了點什麼。請連接點並告訴我如何繼續。
參考解法
方法 1:
I had done a similar problem in java sometimes its algorithm can help you
Check out it at https://github.com/sreeragrnandan/JAVA‑ASSIGNMENT/blob/master/Mdis.java
(by Joker、SREERAG R NANDAN)