package
Version:
v0.0.0-...-377b65c
Opens a new window with list of versions in this module.
Published: Oct 25, 2024
License: MIT
Opens a new window with license information.
Imports: 10
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package ransac contains an implementation of the RANSAC algorithm.
-
func Plot(path string, x, y []float64, ps []float64, fn ModelFn, labelX, labelY string)
-
func Ransac(x, y []float64, model ModelFn, nParams int, p MetaParams) (*optimize.Location, error)
-
type MetaParams
-
type ModelFn
Plot is a helper to plot the results of a RANSAC iteration.
Ransac runs the RANSAC algorithm, trying to find model parameters for ModelFn
according to the meta parameters.
type MetaParams struct {
MinModelPoints int
MaxIter int
MinInliers int
InlierThreshold float64
Seed int64
}
MetaParams contains the meta-parameters for a RANSAC search.
Check validates RANSAC params and will panic if there are invalid settings.
ModelFn represents the model to be fitted during RANSAC.
It has to be implemented by the user.
Example (poly2):
func(x float64, params []float64) float64 {
return params[0] + params[1]*x + params[2]*x*x
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.