-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jacobian Computation #4
Comments
I don't know how you derived the equation after this sentence, but Jacobians are supposed to have the same weights as residuals, since they are related. Please see equation (28-30) in the paper for their relation. Also, please see equation (22) and (25) in the original paper, where you can see that the weights On the other hand, you can think about the intuition behind it. It does not make sense to add weights to only residuals but not Jacobians. Leaving Jacobians with no weights is equivalent to assigning a weight of one, which makes it inconsistent with the weights of residuals. Besides, the equation you pointed out in the supplementary is the objective function for RGB-D alignment. The authors wanted to say that they borrowed the idea from RGB-D alignment and applied it to point cloud registration. The corresponding objective function is listed in equation (17) in the paper. |
My apologies for this miskate. You're right. Weights should be added to the Jacbobian because the residual is the function and the weighted function will affect the Jacobian too. However, I still think there is a issue here: the weight should be As you mentioned before, the core of this reisdual function is listed in equation (17). So the aggregated residual function is: Suppose the respective Jacobian of the aggregated Gaussian-Newton Iteration equation is: where Your codes are: Eigen::Matrix6d JTJ_G = JacobianGeo * JacobianGeo.transpose();
Eigen::Vector6d JTr_G = JacobianGeo * ResidualGeo;
Eigen::Matrix6d JTJ_C = JacobianColor * JacobianColor.transpose();
Eigen::Vector6d JTr_C = JacobianColor * ResidualColor;
Eigen::Matrix6d JTJ = sqrt(lambda) * JTJ_G + sqrt(1-lambda) * JTJ_C;
Eigen::Vector6d JTr = sqrt(lambda) * JTr_G + sqrt(1-lambda) * JTr_C; While I think we do not need to calculate the squared root of Eigen::Matrix6d JTJ_G = JacobianGeo * JacobianGeo.transpose();
Eigen::Vector6d JTr_G = JacobianGeo * ResidualGeo;
Eigen::Matrix6d JTJ_C = JacobianColor * JacobianColor.transpose();
Eigen::Vector6d JTr_C = JacobianColor * ResidualColor;
Eigen::Matrix6d JTJ = lambda * JTJ_G + (1-lambda) * JTJ_C;
Eigen::Vector6d JTr = lambda* JTr_G + (1-lambda) * JTr_C; Another alternative is an aggregated version: Jacobain << sqrt(lambda)*JacobianGeo, sqrt(1-lambda)*JacobianColor; // concatenate cols
Residual << sqrt(lambda)*ResidualGeo, sqrt(1-lambda)*ResidualColor;
Eigen::MatrixXd JJT = Jacobain * Jacobain.transpose();
Eigen::MatrixXd Jr = Jacobain * Residual; |
@hanzheteng , I have a question about Jacobian computation here.
I assume the weights should be added only on JTr rather than both on JTJ and JTr. My reasons are below.
In the supplementary materials of Colored ICP, the original residual function is:
The aggregated residual and Jacobian are:
For C++ implementation, it should be:
This is equivalent to adding weights on
$$JJ^T=J_GJ_G^T+J_CJ_C^T$$ .
JTr
but not onJTJ
. Due to the combined rows and matrix operation,I believe your implementation is right, because I also implement it with ceres-solver's Autodifferentiable function and its result is more similar to yours. However, I still have no idea about what is wrong.
The text was updated successfully, but these errors were encountered: