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 AlgebraicCircleReturns aAlgebraicCircleinstance for this fit ornullif the fit was unsuccessful.static RealMatrixgetDecenteringMatrix(double xr, double yr) Used to transform the algebraic parameter vector for sample data shifted to the reference point specified.static CircleFitAlgebraicgetFit(CircleFitAlgebraic.FitType type, Pnt2d[] points) Creates and returns a new circle fit instance of the specified type for the given sample points.default GeometricCircleReturns aGeometricCircleinstance for this fit ornullif the fit was unsuccessful.double[]Returns parameters (A, B, C, D) of theAlgebraicCircleornullif 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 theAlgebraicCircleornullif the fit was unsuccessful. Parameters are not normalized.- Returns:
- the algebraic circle parameters or
null
-
getAlgebraicCircle
Returns aAlgebraicCircleinstance for this fit ornullif the fit was unsuccessful.- Returns:
- a
AlgebraicCircleinstance or null
-
getGeometricCircle
Returns aGeometricCircleinstance for this fit ornullif the fit was unsuccessful.- Returns:
- a
GeometricCircleinstance 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
-