iris-ua / iris_lama

LaMa - A Localization and Mapping library
BSD 3-Clause "New" or "Revised" License
336 stars 72 forks source link

a problem about iris_lama(2) #36

Open alonly2024 opened 2 weeks ago

alonly2024 commented 2 weeks ago

@eupedrosa but I encountered a problem abut the sover,I want to add weights to different points。 I don't know how to add weights to different points in solve。Can I add *k in residuals[i]?Can i need change the J->row(i)?

alonly2024 commented 2 weeks ago

@eupedrosa My approach is to analyze the curvature of each point. For points with smaller curvature or farther distances, the weights will be set relatively high when solving. But I don't know how to put this weight into the solving. My current approach is to modify residues [i] multiplied by k , J ->row (i) multiplied by k.in loc::MatchSurface2D::eval(). I don't know if it's correct?

eupedrosa commented 2 weeks ago

Assuming that W is a NxN diagonal matrix, I think you need the following changes:

VectorXd g = J.transpose() * W * residuals;
// and
MatrixXd A = J.transpose() * W * J;

Nonetheless, lama already does robust fitting. The goal is to reduce the weight of points with higher error. Maybe it already does what you want.

If you want to use the weighted strategy, you may need to change the solver.cpp to remove the parts where a weight is calculated for the robust fitting.