Ask Your Question

Revision history [back]

jacobian in LM optimization in findhomography

I'm trying to understand the code of findhomography function, while for the pose refine after ransac/prosac, ie. the 'createLMSolver(makePtr<homographyrefinecallback>(src, dst), 10)->run(H8);' line in findHomography() function, I'm confused about the computation of the jacobian (in the compute() function of HomographyRefineCallback when implementing the LM solver:

Jptr[0] = Mxww; Jptr[1] = Myww; Jptr[2] = ww; Jptr[3] = Jptr[4] = Jptr[5] = 0.; Jptr[6] = -Mxwwxi; Jptr[7] = -Mywwxi; Jptr[8] = Jptr[9] = Jptr[10] = 0.; Jptr[11] = Mxww; Jptr[12] = Myww; Jptr[13] = ww; Jptr[14] = -Mxwwyi; Jptr[15] = -Mywwyi;

The source and dest points are 2d points, and the homography matrix to refine is a 3*3 matrix (opencv sets the last element to 1, so h has 8 elements here), so why the jacobian here has 16 elements? Could anyone explain it, or provide the original paper on this solution here?

Thanks!

click to hide/show revision 2
None

jacobian in LM optimization in findhomography

I'm trying to understand the code of findhomography function, while for the pose refine after ransac/prosac, ie. the 'createLMSolver(makePtr<homographyrefinecallback>(src, createLMSolver(makePtr<HomographyRefineCallback>(src, dst), 10)->run(H8);' 10)->run(H8); line in findHomography() findHomography() function, I'm confused about the computation of the jacobian (in the compute() function of HomographyRefineCallback HomographyRefineCallback when implementing the LM solver:

Jptr[0] = Mxww; Mx*ww; Jptr[1] = Myww; My*ww; Jptr[2] = ww;
Jptr[3] = Jptr[4] = Jptr[5] = 0.;
Jptr[6] = -Mxwwxi; -Mx*ww*xi; Jptr[7] = -Mywwxi;
-My*ww*xi;
Jptr[8] = Jptr[9] = Jptr[10] = 0.;
Jptr[11] = Mxww; Mx*ww; Jptr[12] = Myww; My*ww; Jptr[13] = ww;
Jptr[14] = -Mxwwyi; -Mx*ww*yi; Jptr[15] = -Mywwyi;

-My*ww*yi;

The source and dest points are 2d points, and the homography matrix to refine is a 3*3 matrix (opencv sets the last element to 1, so h has 8 elements here), so why the jacobian here has 16 elements? Could anyone explain it, or provide the original paper on this solution here?

Thanks!