tum-vision / dvo_slam

Dense Visual Odometry and SLAM
632 stars 306 forks source link

My result of Jacobian is different #22

Open clones1201 opened 9 years ago

clones1201 commented 9 years ago

I did the math and have a different Jacobian matrix as showing in my new code, you guys may want to check it.

christiankerl commented 9 years ago

can you share your calculations?

clones1201 commented 9 years ago

as the parameters is (q0 q1 q2 t0 t1 t2) T the rigid transform is :
(x',y',z')T = | 1 -q2 q1 | (x,y,z)T + ( t0,t1,t2)T | q2 1 -q0 | | -q1 q0 1 |

and the projection is :
(u,v)T = ( x * fx / z + cx, y * fy / z + cy)T

so we have a Jacobian of the rigid transform: | 0 z -y 1 0 0 | | -z 0 x 0 1 0 | | y -x 0 0 0 1 | and a Jacobian of the projection : | 1/z 0 -y/z^2 | |0 1/z -x/z^2 |

so the Jacobian of the warp function is: | -y^2/z^2 1+x_y/z^2 -y/z 1/z 0 -y/z^2 | | -1-x_y/z^2 x^2/z^2 x/z 0 1/z -x/z^2 |

and i test it with the freiburg1/room benchmark, looks good.

==========edit============= Projection Jacobian should be | 1/z 0 -x/z^2 | |0 1/z -y/z^2 | then the result is as same as the code... oh, my poor math...

christiankerl commented 9 years ago

why are the rows of the projection Jacobian swapped?

clones1201 commented 9 years ago

I think i know the problem,my mistake,sorry...