Module imagingbook.common
Interface CircleFitAlgebraic
- All Known Implementing Classes:
CircleFit3Points
,CircleFitHyperSimple
,CircleFitHyperStable
,CircleFitKasaA
,CircleFitKasaB
,CircleFitKasaC
,CircleFitPratt
,CircleFitTaubin
public interface CircleFitAlgebraic
Common interface for all algebraic circle fits.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault AlgebraicCircle
Returns aAlgebraicCircle
instance for this fit ornull
if the fit was unsuccessful.static RealMatrix
getDecenteringMatrix
(double xr, double yr) Used to transform the algebraic parameter vector for sample data shifted to the reference point specified.static CircleFitAlgebraic
getFit
(CircleFitAlgebraic.FitType type, Pnt2d[] points) Creates and returns a new circle fit instance of the specified type for the given sample points.default GeometricCircle
Returns aGeometricCircle
instance for this fit ornull
if the fit was unsuccessful.double[]
Returns parameters (A, B, C, D) of theAlgebraicCircle
ornull
if the fit was unsuccessful.default double[]
normalizeP
(double[] q) Normalize parameter vector q=(A,B,C,D) by enforcing the constraint B^2 + C^2 - 4 A D = 1.
-
Method Details
-
getFit
Creates and returns a new circle fit instance of the specified type for the given sample points.- Parameters:
type
- the circle fit typepoints
- an array of 2D sample points- Returns:
- a new circle fit instance
- See Also:
-
getParameters
double[] getParameters()Returns parameters (A, B, C, D) of theAlgebraicCircle
ornull
if the fit was unsuccessful. Parameters are not normalized.- Returns:
- the algebraic circle parameters or
null
-
getAlgebraicCircle
Returns aAlgebraicCircle
instance for this fit ornull
if the fit was unsuccessful.- Returns:
- a
AlgebraicCircle
instance or null
-
getGeometricCircle
Returns aGeometricCircle
instance for this fit ornull
if the fit was unsuccessful.- Returns:
- a
GeometricCircle
instance or null
-
getDecenteringMatrix
Used to transform the algebraic parameter vector for sample data shifted to the reference point specified. If qq is the parameter vector for the data centered at (xr, yr), the original parameters q are obtained asq = M * qq
- Parameters:
xr
- reference point (x)yr
- reference point (y)- Returns:
- the transformation matrix
-
normalizeP
Normalize parameter vector q=(A,B,C,D) by enforcing the constraint B^2 + C^2 - 4 A D = 1.- Parameters:
q
- original parameter vector- Returns:
- normalized parameter vector
-