D1vt / DLT3D

0 stars 0 forks source link

Explaining difference between mine & Yue's code #10

Closed D1vt closed 5 years ago

D1vt commented 5 years ago

Yue's code: https://github.com/EgalYue/Mobile_Marker_Based_Navigation/blob/e1dd1267d8a623f047bc430da11521d28d82f4cb/python/tracking_errors_theory/covariance_mat_sphericalCoordinate.py#L28

This is the final function to calculate the covariance matrix.

In my code I have create this function instead: https://github.com/D1vt/DLT3D/blob/511fbb2b21b0c0750d0e0e65c6aa9db3abb0d240/Python/sphere.py#L272

For the Jacobian function Yue is using 2 functions:

  1. https://github.com/EgalYue/Mobile_Marker_Based_Navigation/blob/e1dd1267d8a623f047bc430da11521d28d82f4cb/python/tracking_errors_theory/covariance_mat_sphericalCoordinate.py#L129 2.https://github.com/EgalYue/Mobile_Marker_Based_Navigation/blob/e1dd1267d8a623f047bc430da11521d28d82f4cb/python/tracking_errors_theory/covariance_mat_sphericalCoordinate.py#L144

On the other hand I am creating all the matrices (dP/da , dP/db, dP/dc) using these functions:

  1. to calculate the a,b,r for spherical coordinates : https://github.com/D1vt/DLT3D/blob/511fbb2b21b0c0750d0e0e65c6aa9db3abb0d240/Python/sphere.py#L255 2.here I calculate the derivatives: https://github.com/D1vt/DLT3D/blob/511fbb2b21b0c0750d0e0e65c6aa9db3abb0d240/Python/sphere.py#L342 3.And here I calculate the final P matrix & derivatives: https://github.com/D1vt/DLT3D/blob/511fbb2b21b0c0750d0e0e65c6aa9db3abb0d240/Python/sphere.py#L321

Regarding the final results for the same set of worldpoints covmatrix is the result from my code and cov from Yue's, you can see that we almost get the same results.

Example 1. image

Example 2. image

What changes I made to Yue's code:

  1. here : https://github.com/EgalYue/Mobile_Marker_Based_Navigation/blob/e1dd1267d8a623f047bc430da11521d28d82f4cb/python/tracking_errors_theory/covariance_mat_sphericalCoordinate.py#L174 it is not (-) , but (+) 2.here: https://github.com/EgalYue/Mobile_Marker_Based_Navigation/blob/e1dd1267d8a623f047bc430da11521d28d82f4cb/python/tracking_errors_theory/covariance_mat_sphericalCoordinate.py#L68 , he used a=0.0 , b=0.0 , r=0.0 . I correct the code so that to use a,b,r from the origin. 3.About Euler Angle: he used this matrix: https://github.com/EgalYue/Mobile_Marker_Based_Navigation/blob/e1dd1267d8a623f047bc430da11521d28d82f4cb/python/tracking_errors_theory/covariance_mat_sphericalCoordinate.py#L175 and a=0.0, b=180.0 , c=0.0 , but according to the Thesis Tracking Errors in Augmented Reality for Laparoscopic Surgeries (p. 51) a,b,c are depending on the R matrix and the final matrix is calculated as you can see here: https://github.com/D1vt/DLT3D/blob/d21d136a45b1815dabcfd0a7ef67b24e3d39af4b/Python/sphere.py#L307
raultron commented 5 years ago

I would like to see your derivatives calculation if you have them, take some photos and put them here. thanks!

D1vt commented 5 years ago

Sure: image

and

image

But you can also see it in my code from here: https://github.com/D1vt/DLT3D/blob/d21d136a45b1815dabcfd0a7ef67b24e3d39af4b/Python/sphere.py#L359