Re: [問題] 關於攝影機內部參數的問題

作者: damody (天亮damody)   2014-05-18 05:28:51
※ 引述《svsv (SV)》之銘言:
: 不知道要在哪個板PO 不知道在這個板有沒有違規
: 有的話請告知 謝謝
: 小弟在參考文縣中 常常看到以下兩種攝影機內部參數矩陣
: http://ppt.cc/zD98
: http://ppt.cc/H~1P
: 想問各位高手的是
: 理論上 f(焦距)跟 beta 是不太可能一樣的
: 為什麼會有這兩種方式的校正 還是說 這兩個矩陣之間有什麼關係嗎
心血來潮查了一下
我先說我不是這領域的專家
http://en.wikipedia.org/wiki/Camera_resectioning
我發現大家的calibration matrix都有點不一樣
有些解3x3 有些 4x4
但都是 upper matrix
從wiki可以看到
alphaX = f dot mx
alphay = f dot my
garma = skew = s
所以你查到的這兩個矩陣意思上是一樣的
A是要解Ax=b時的狀態了
最後為了跟c/c++扯上關係
一個 eigen 解矩陣的範例
其實 opencv 有 function 一行解決
// 填A矩陣
// 解 Ax=b
void test_EigenLU()
{
const int LEN = I_DONT_CARE;
const int DIM = 3;
MatrixXd A(LEN, DIM), At, Ata;
VectorXd b1(LEN), x1(DIM), Atb1;
int c = 0;
for (int y = 0; y < LEN; ++y)
{
for (int x = 0; x < img.rows; ++x)
{
b1.coeffRef(c) = YOUR_VALUE;
A.coeffRef(0, 0) = alphaX;
A.coeffRef(0, 1) = s;
A.coeffRef(0, 2) = u0;
A.coeffRef(1, 1) = alphaY;
A.coeffRef(1, 2) = v0;
A.coeffRef(2, 2) = 1;
c++;
}
}
At = A.transpose();
Ata = At * A;
Atb1 = At * b1;
Eigen::PartialPivLU<MatrixXd> Atalu = Ata.lu();
x1 = Atalu.solve(Atb1);
}

Links booklink

Contact Us: admin [ a t ] ucptt.com