Skip to content

Commit 667cb60

Browse files
committed
Update equations number related to the paper last version
1 parent e48d148 commit 667cb60

14 files changed

+33
-30
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
svn-commit.tmp*
21
*~
2+
*/CMakeFiles
3+
CMakeCache.txt
4+
.DS_Store
5+
CMakeLists.txt.user*

doc/tutorial-homography-opencv.doc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ From a vector of planar points \f${\bf x_1} = (x_1, y_1, 1)^T\f$ in image \f$I_1
2626

2727
\f[\bf x_2 = {^2}H_1 x_1\f]
2828

29-
The implementation of the Direct Linear Transform algorithm to estimate \f$\bf {^2}H_1\f$ is done next. First, for each point we update the values of matrix A using equation (33). Then we solve the system \f${\bf Ah}=0\f$ using a Singular Value Decomposition of \f$\bf A\f$. Finaly, we determine the smallest eigen value that allows to identify the eigen vector that corresponds to the solution \f$\bf h\f$.
29+
The implementation of the Direct Linear Transform algorithm to estimate \f$\bf {^2}H_1\f$ is done next. First, for each point we update the values of matrix A using equation (23). Then we solve the system \f${\bf Ah}=0\f$ using a Singular Value Decomposition of \f$\bf A\f$. Finaly, we determine the smallest eigen value that allows to identify the eigen vector that corresponds to the solution \f$\bf h\f$.
3030

3131
\snippet homography-dlt-opencv.cpp DLT
3232

doc/tutorial-homography-visp.doc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ From a vector of planar points \f${\bf x_1} = (x_1, y_1, 1)^T\f$ in image \f$I_1
2626

2727
\f[\bf x_2 = {^2}H_1 x_1\f]
2828

29-
The implementation of the Direct Linear Transform algorithm to estimate \f$\bf {^2}H_1\f$ is done next. First, for each point we update the values of matrix A using equation (33). Then we solve the system \f${\bf Ah}=0\f$ using a Singular Value Decomposition of \f$\bf A\f$. Finaly, we determine the smallest eigen value that allows to identify the eigen vector that corresponds to the solution \f$\bf h\f$.
29+
The implementation of the Direct Linear Transform algorithm to estimate \f$\bf {^2}H_1\f$ is done next. First, for each point we update the values of matrix A using equation (23). Then we solve the system \f${\bf Ah}=0\f$ using a Singular Value Decomposition of \f$\bf A\f$. Finaly, we determine the smallest eigen value that allows to identify the eigen vector that corresponds to the solution \f$\bf h\f$.
3030

3131
\snippet homography-dlt-visp.cpp DLT
3232

doc/tutorial-pose-dlt-planar-opencv.doc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Then we introduce the function that does the homography estimation from coplanar
2626
Then we introduce the function that does the pose from homography estimation.
2727
\snippet pose-from-homography-dlt-opencv.cpp Estimation function
2828

29-
Based on equation (37) \f${\bf x}_0 = {^0}{\bf H}_w {\bf x}_w\f$ we first estimate the homography \f${^0}{\bf H}_w\f$.
29+
Based on equation (27) \f${\bf x}_0 = {^0}{\bf H}_w {\bf x}_w\f$ we first estimate the homography \f${^0}{\bf H}_w\f$.
3030
\snippet pose-from-homography-dlt-opencv.cpp Homography estimation
3131

3232
Then using the constraint that \f$||{\bf c}^0_1|| = 1\f$ we normalize the homography.
@@ -56,7 +56,7 @@ Then we create the data structures that will contain the 3D points coordinates \
5656
\snippet pose-from-homography-dlt-opencv.cpp Create data structures
5757

5858
For our simulation we then initialize the input data from a ground truth pose with the translation in \e ctw_truth and the rotation matrix in \e cRw_truth.
59-
For each point \e wX[i] we compute the perspective projection \e xo[i] = (xo, yo, 1). According to equation (37) we also set \f${\bf x}_w = ({^w}X, {^w}Y, 1)\f$ in \e xw vector.
59+
For each point \e wX[i] we compute the perspective projection \e xo[i] = (xo, yo, 1). According to equation (27) we also set \f${\bf x}_w = ({^w}X, {^w}Y, 1)\f$ in \e xw vector.
6060
\snippet pose-from-homography-dlt-opencv.cpp Simulation
6161

6262
From here we have initialized \f${\bf x_0} = (x_0,y_0,1)^T\f$ and \f${\bf x}_w = ({^w}X, {^w}Y, 1)^T\f$. We are now ready to call the function that does the pose estimation.

doc/tutorial-pose-dlt-planar-visp.doc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Then we introduce the function that does the homography estimation from coplanar
2626
Then we introduce the function that does the pose from homography estimation.
2727
\snippet pose-from-homography-dlt-visp.cpp Estimation function
2828

29-
Based on equation (37) \f${\bf x}_0 = {^0}{\bf H}_w {\bf x}_w\f$ we first estimate the homography \f${^0}{\bf H}_w\f$.
29+
Based on equation (27) \f${\bf x}_0 = {^0}{\bf H}_w {\bf x}_w\f$ we first estimate the homography \f${^0}{\bf H}_w\f$.
3030
\snippet pose-from-homography-dlt-visp.cpp Homography estimation
3131

3232
Then using the constraint that \f$||{\bf c}^0_1|| = 1\f$ we normalize the homography.
@@ -56,7 +56,7 @@ Then we create the data structures that will contain the 3D points coordinates \
5656
\snippet pose-from-homography-dlt-visp.cpp Create data structures
5757

5858
For our simulation we then initialize the input data from a ground truth pose \e oTw_truth.
59-
For each point \e wX[i] we compute the perspective projection \e xo[i] = (xo, yo, 1). According to equation (37) we also set \f${\bf x}_w = ({^w}X, {^w}Y, 1)\f$ in \e xw vector.
59+
For each point \e wX[i] we compute the perspective projection \e xo[i] = (xo, yo, 1). According to equation (27) we also set \f${\bf x}_w = ({^w}X, {^w}Y, 1)\f$ in \e xw vector.
6060
\snippet pose-from-homography-dlt-visp.cpp Simulation
6161

6262
From here we have initialized \f${\bf x_0} = (x_0,y_0,1)^T\f$ and \f${\bf x}_w = ({^w}X, {^w}Y, 1)^T\f$. We are now ready to call the function that does the pose estimation.

opencv/homography-basis/homography-dlt-opencv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ cv::Mat homography_dlt(const std::vector< cv::Point2d > &x1, const std::vector<
2121

2222
// Since the third line of matrix A is a linear combination of the first and second lines
2323
// (A is rank 2) we don't need to implement this third line
24-
for(int i = 0; i < npoints; i++) { // Update matrix A using eq. 33
24+
for(int i = 0; i < npoints; i++) { // Update matrix A using eq. 23
2525
A.at<double>(2*i,3) = -x1[i].x; // -xi_1
2626
A.at<double>(2*i,4) = -x1[i].y; // -yi_1
2727
A.at<double>(2*i,5) = -1; // -1

opencv/homography-basis/pose-from-homography-dlt-opencv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ cv::Mat homography_dlt(const std::vector< cv::Point2d > &x1, const std::vector<
2121

2222
// Since the third line of matrix A is a linear combination of the first and second lines
2323
// (A is rank 2) we don't need to implement this third line
24-
for(int i = 0; i < npoints; i++) { // Update matrix A using eq. 33
24+
for(int i = 0; i < npoints; i++) { // Update matrix A using eq. 23
2525
A.at<double>(2*i,3) = -x1[i].x; // -xi_1
2626
A.at<double>(2*i,4) = -x1[i].y; // -yi_1
2727
A.at<double>(2*i,5) = -1; // -1

opencv/pose-basis/pose-dementhon-opencv.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void pose_dementhon(const std::vector< cv::Point3d > &wX,
1616
int npoints = (int)wX.size();
1717
cv::Mat r1, r2, r3;
1818
cv::Mat A(npoints, 4, CV_64F);
19-
for(int i = 0; i < npoints; i++) { // Equation (12)
19+
for(int i = 0; i < npoints; i++) {
2020
A.at<double>(i,0) = wX[i].x;
2121
A.at<double>(i,1) = wX[i].y;
2222
A.at<double>(i,2) = wX[i].z;
@@ -34,11 +34,11 @@ void pose_dementhon(const std::vector< cv::Point3d > &wX,
3434
// POSIT loop
3535
for(unsigned int iter = 0; iter < 20; iter ++) {
3636
for(int i = 0; i < npoints; i++) {
37-
Bx.at<double>(i,0) = x[i].x * (eps.at<double>(i,0) + 1.); // Equation (13)
38-
By.at<double>(i,0) = x[i].y * (eps.at<double>(i,0) + 1.); // Equation (14)
37+
Bx.at<double>(i,0) = x[i].x * (eps.at<double>(i,0) + 1.);
38+
By.at<double>(i,0) = x[i].y * (eps.at<double>(i,0) + 1.);
3939
}
4040

41-
I = Ap * Bx; // Equation (15). Notice that the pseudo inverse
41+
I = Ap * Bx; // Notice that the pseudo inverse
4242
J = Ap * By; // of matrix A is a constant that has been precompiled.
4343

4444
for (int i = 0; i < 3; i++) {
@@ -54,7 +54,7 @@ void pose_dementhon(const std::vector< cv::Point3d > &wX,
5454
}
5555
normI = sqrt(normI);
5656
normJ = sqrt(normJ);
57-
r1 = Istar / normI; // Equation (16)
57+
r1 = Istar / normI;
5858
r2 = Jstar / normJ;
5959
r3 = r1.cross(r2);
6060

opencv/pose-basis/pose-dlt-opencv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void pose_dlt(const std::vector< cv::Point3d > &wX, const std::vector< cv::Point
1414
int npoints = (int)wX.size();
1515
cv::Mat A(2*npoints, 12, CV_64F, cv::Scalar(0));
1616
for(int i = 0; i < npoints; i++) { // Update matrix A using eq. 5
17-
A.at<double>(2*i, 0) = wX[i].x; //wX[i][0] ;
17+
A.at<double>(2*i, 0) = wX[i].x;
1818
A.at<double>(2*i, 1) = wX[i].y;
1919
A.at<double>(2*i, 2) = wX[i].z;
2020
A.at<double>(2*i, 3) = 1 ;

opencv/pose-basis/pose-gauss-newton-opencv.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ void pose_gauss_newton(const std::vector< cv::Point3d > &wX,
6565
for (int i = 0; i < npoints; i++) {
6666
cX = cRw * cv::Mat(wX[i]) + ctw; // Update cX, cY, cZ
6767
// Update x(q)
68-
xq.at<double>(i*2,0) = cX.at<double>(0,0) / cX.at<double>(2,0); // x(q) = cX/cZ
69-
xq.at<double>(i*2+1,0) = cX.at<double>(1,0) / cX.at<double>(2,0); // y(q) = cY/cZ
68+
xq.at<double>(i*2,0) = cX.at<double>(0,0) / cX.at<double>(2,0); // x(q) = cX/cZ
69+
xq.at<double>(i*2+1,0) = cX.at<double>(1,0) / cX.at<double>(2,0); // y(q) = cY/cZ
7070

71-
// Update J using equation (22)
71+
// Update J using equation (11)
7272
J.at<double>(i*2,0) = -1/cX.at<double>(2,0); // -1/cZ
7373
J.at<double>(i*2,1) = 0;
7474
J.at<double>(i*2,2) = x[i].x / cX.at<double>(2,0); // x/cZ
@@ -84,10 +84,10 @@ void pose_gauss_newton(const std::vector< cv::Point3d > &wX,
8484
J.at<double>(i*2+1,5) = -x[i].y; // -x
8585
}
8686

87-
cv::Mat e_q = xq - xn; // Equation (18)
87+
cv::Mat e_q = xq - xn; // Equation (7)
8888

8989
cv::Mat Jp = J.inv(cv::DECOMP_SVD); // Compute pseudo inverse of the Jacobian
90-
cv::Mat dq = -lambda * Jp * e_q; // Equation (21)
90+
cv::Mat dq = -lambda * Jp * e_q; // Equation (10)
9191

9292
cv::Mat dctw(3,1,CV_64F), dcRw(3,3,CV_64F);
9393
exponential_map(dq, dctw, dcRw);

0 commit comments

Comments
 (0)