miguelriemoliveira / OptimizationUtils

A set of utilities for using the python scipy optimizer functions
GNU General Public License v3.0
6 stars 0 forks source link

Definition of residuals #64

Closed manuelgitgomes closed 2 years ago

manuelgitgomes commented 2 years ago

Good evening. When trying to calibrate two 2D LIDAR sensors with each other, there is a residuals between each point captured, correct? Because, if so, I have 541 points. To calibrate between each point, residuals are 541², equaling 292681 residuals, which might be too computationally intensive for my machine to handle. Am I formulating the problem correctly and simply need to wait for it to process all, or is there and error in my formulation?

miguelriemoliveira commented 2 years ago

Hi @manuelgitgomes ,

let's say you have Nx points in scan x, and No points in scan o.

scan x: x x x xxxxx x x x

scan o: o o o oooooo o o o

Now let's assume we the goal is to calibrate x in o, then you have to search for each x the closest o, and the residual corresponding to that x in the minimum distance between x and all os.

This way you have only Nx residuals and it works very fast.

miguelriemoliveira commented 2 years ago

Does it make sense?

miguelriemoliveira commented 2 years ago

for each x the closest o would mean

for each x, compute the distance to all os and take the minimum.

This is common in the ICP algorithm https://en.wikipedia.org/wiki/Iterative_closest_point

manuelgitgomes commented 2 years ago

It makes sense! I will try it ASAP. Thank you!

manuelgitgomes commented 2 years ago

It worked a lot better. Still some problem, will be better defined in #65. This issue is now closed.

miguelriemoliveira commented 2 years ago

OK, great. Bear in mind that you may have problems with the association, unless the initial value of the transformation is very close to the real solution.

This is a common thing with the ICP algorithm, which is know to often fall into local minima unless a good initialization is provided.

manuelgitgomes commented 2 years ago

Exactly, we are having that problem right now.