@ALDAOperator(genericExecutionMode=NONE, level=STANDARD) public class FitEllipseToPointSet extends MTBOperator
An ellipse is a special case of a general quadratic curve defined by the following implicit equation:
The curve equation yields always an elliptical solution if
The algorithm basically solves an eigenvalue problem:
To ensure that the scatter matrix S is invertible, the algorithm expects a point set containing at least 6 points in general position, i.e. matrix S is required to have full rank. Note that this condition is also not fulfilled if the given points are all lying exactly (!) on a single ellipse, i.e., if the algebraic error is zero. In that case the operator will return no result, but the estimated curve will be null.
The result is returned as an object of class
MTBQuadraticCurve2D
with type ellipse.
Details concerning the algorithm can be found in
Pilu et al.,
Ellipse-specific Direct Least-Square Fitting, Proc. of
IEEE International Conference on Image Processing, Lausanne,
September 1996
(Webpage).
MTBQuadraticCurve2D
,
FitQuadraticCurveToPointSet
,
Ellipses on WolframMathWorld,
Efficient Java Matrix LibraryModifier and Type | Field and Description |
---|---|
private MTBQuadraticCurve2D |
curve
Estimated curve.
|
private Vector<Point2D.Double> |
points
Input set of points.
|
Constructor and Description |
---|
FitEllipseToPointSet()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
MTBQuadraticCurve2D |
getEstimatedCurve()
Get estimated curve.
|
protected void |
operate() |
void |
setPointSet(Vector<Point2D.Double> p)
Set input set of 2D points.
|
void |
validateCustom() |
readResolve
addOperatorExecutionProgressEventListener, addParameter, addParameter, addParameterUnconditioned, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getDocumentation, getHidingMode, getInactiveParameterNames, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterDescriptorUnconditioned, getParameterNames, getParameterUnconditioned, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, hasInOutParameters, hasParameter, isAnnotatedParameter, isConfigured, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, removeParameter, runOp, runOp, runOp, setConstructionMode, setConstructionMode, setConstructionMode, setHidingMode, setName, setParameter, setParameterUnconditioned, setVerbose, toStringVerbose, unconfiguredItems, validate, validateGeneric, writeHistory, writeHistory, writeHistory
@Parameter(label="Point Set", required=true, dataIOOrder=0, direction=IN, description="Point Set.") private Vector<Point2D.Double> points
@Parameter(label="Curve", dataIOOrder=1, direction=OUT, description="Estimated curve.") private MTBQuadraticCurve2D curve
public FitEllipseToPointSet() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- Thrown in case of operate failure.public void validateCustom() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
validateCustom
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected void operate() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public void setPointSet(Vector<Point2D.Double> p)
p
- Set of points to process.public MTBQuadraticCurve2D getEstimatedCurve()
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.