danini / magsac

The MAGSAC algorithm for robust model fitting without using an inlier-outlier threshold
Other
429 stars 65 forks source link

Is it using for Roust Line Regression? #24

Open wuyuanmm opened 3 years ago

danini commented 1 year ago

It does not have code for 2D line fitting but should be reasonably easy to implement if needed. Is it still relevant?

wuyuanmm commented 1 year ago

It would be great if you had the time to implement it. and I will try to implement it. Thanks for your reply!

tvercaut commented 1 year ago

On a related note, it it possible to get a generic implementation that would require the user to provide their own model with a suitable (weighted least squares) fitting function?

danini commented 1 year ago

Robust line fitting is available: https://github.com/danini/magsac/blob/master/examples/example_line_fitting.ipynb I didn't yet to a very thorough testing, but it should work with no problem.

danini commented 1 year ago

On a related note, it it possible to get a generic implementation that would require the user to provide their own model with a suitable (weighted least squares) fitting function?

Actually, adding new models is pretty easy. You simply have to add a new estimator into estimators.h (with LSQ and the residual function). If you want to have a Python binding for the new estimator as well, you simply have to add a new function in magsac_python.cpp and bindings.cpp. So adding new models is I would say pretty easy.