alejocb / dpptam

DPPTAM: Dense Piecewise Planar Tracking and Mapping from a Monocular Sequence
GNU General Public License v3.0
219 stars 82 forks source link

Question regarding Gauss Newton update step #13

Closed sunghoon031 closed 8 years ago

sunghoon031 commented 8 years ago

In SemiDenseTracking.cpp "gauss_newton_ic" function, there is a following code:

for (int ii = 0; ii <6;ii++)
{
    jacobian.rowRange(0,jacobian.rows).colRange(ii,ii+1) = weight.mul(jacobian_analitic.rowRange(0,jacobian_analitic.rows).colRange(ii,ii+1) );
}

init = (jacobian.t()*jacobian).inv(cv::DECOMP_SVD)*jacobian.t();

cv::Mat init2;
init2 = init*(error_vector_sqrt_inicial.mul(weight)) ;

And in "optimize_camera" function, right after performing "gauss_estimation", you run the following code:

weight[j] = (1 + (error_vector[j]/(variances[j])));
weight[j] = 1/weight[j];
weight[j] = weight[j].mul(weight[j]);

Here are my questions:

  1. According to the first code you are computing init2 = (J.t()_W^2_J).inv()_J.t()_r(0)*W where J = jacobian_analitic. (W^2 because jacobian in your init calculation is already multiplied by weight). Was this intended because having W^2 was better than W?
  2. According to the following link https://research.microsoft.com/en-us/um/people/zhang/INRIA/Publis/Tutorial-Estim/node24.html, I see that the equation for the weight function is pretty different. Can you give me the reference for your weight function equation?

Thanks in advance and I will look forward to your reply ! :+1:

alejocb commented 8 years ago

HI,

Thank you for your interest. Regarding the first question, It seems I made a mistake when I programmed it, I should have used W and not W^2, I will update it very soon, thank you!!

Regarding the second question, I used the robust cost function called 'Geman-McClure'. I obtained good results in sequences with big occlusions and this is the reason why I finally used this one, but other ones like Tukey's may also work.

Best regards,

Alejo.

sunghoon031 commented 8 years ago

I see. Geman-McClure cost function was in the very link I was looking at XD Thank you for the reply!