Module imagingbook.common
Class EllipseProjector
java.lang.Object
imagingbook.common.geometry.ellipse.project.EllipseProjector
- Direct Known Subclasses:
ConfocalConicEllipseProjector
,OrthogonalEllipseProjector
,OrthogonalEllipseProjectorNewton
Abstract superclass for ellipse projectors, used to find the closest "contact" point on an ellipse for some given target point. Defines specific methods for calculating minimum distance only, i.e., without returning the closest point itself. All calculations are performed in a "canonical" coordinate frame, with the ellipse centered at the origin and its major axis aligned to the x-axis. See Sec. 11.2.2 (Fig. 11.7) of [1] for details.
[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).
- Version:
- 2022/11/17
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected double[]
fromCanonicalFrame
(double[] uv) protected double[]
fromFirstQuadrant
(double[] uv, double[] uvOrig) double
getDistance
(double[] x) Calculates the distance to the closest ellipse point (but not the point itself).double
getDistanceSq
(double[] x) double[]
project
(double[] x) Projects the specified point onto the associated ellipse.Projects the specified point onto the associated ellipse.protected abstract double[]
projectCanonical
(double[] u1) Calculates the projection point in canonical coordinates.protected double[]
toCanonicalFrame
(double[] xy) protected double[]
toFirstQuadrant
(double[] uv)
-
Constructor Details
-
EllipseProjector
-
-
Method Details
-
projectCanonical
Calculates the projection point in canonical coordinates.- Parameters:
u1
- target point in canonical coordinates.- Returns:
- the associated "contact" point on the ellipse
-
project
Projects the specified point onto the associated ellipse.- Parameters:
x
- the 2D point to be projected- Returns:
- the closest point on the ellipse
-
project
Projects the specified point onto the associated ellipse.- Parameters:
pnt
- the 2D point to be projected- Returns:
- the closest point on the ellipse
-
getDistance
Calculates the distance to the closest ellipse point (but not the point itself).- Parameters:
x
- the 2D point to be projected- Returns:
- the distance to the closest ellipse point
-
getDistanceSq
-
toCanonicalFrame
-
fromCanonicalFrame
-
toFirstQuadrant
-
fromFirstQuadrant
-