Package org.jvision.camera.distortion
Interface LensDistortion
- All Known Subinterfaces:
LensDistortionBrown,LensDistortionMetashape,LensDistortionOpenCV
public interface LensDistortion
An interface that enables to group photographic lens distortion models.
In geometric optics, distortion is a deviation from rectilinear projection; a projection in which straight lines in a scene remain straight in an image. It is a form of optical aberration. Various models and convention enable to represents distortion. Moreover, distortion can be made of different components such as:
In geometric optics, distortion is a deviation from rectilinear projection; a projection in which straight lines in a scene remain straight in an image. It is a form of optical aberration. Various models and convention enable to represents distortion. Moreover, distortion can be made of different components such as:
- Radial distortion that is the symmetric distortion caused by the lens due to imperfections in curvature when the lens was ground.
- Tangential (or decentering) distortion that is the non-symmetric distortion due to the misalignment of the lens elements when the camera is assembled.
- Thin prism distortion that arises from slight tilt of lens or image sensor array
- Tilt distortion that is a a perspective distortion caused by image sensor that may be tilted in order to focus an oblique plane in front of the camera (Scheimpflug principle)
- Version:
- "1.0.0" b202104211400L
- Author:
- Julien Seinturier - JOrigin - contact@jorigin.org - https://github.com/jorigin/jvision
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intA flag that indicates that the lens has no distortion distortion.static intA flag that indicates that the distortion has a prism component.static intA flag that indicates that the distortion has a radial component (that can be simple, radial or both).static intA flag that indicates that the radial distortion has a rational component.static intA flag that indicates that the radial distortion has a simple component.static intA flag that indicates that the distortion has a tangential (decentering) component.static intA flag that indicates that the distortion has a tilt component. -
Method Summary
Modifier and TypeMethodDescriptionorg.jeometry.geom2D.point.Point2Ddistort(org.jeometry.geom2D.point.Point2D undistorted)Distort the given point.org.jeometry.geom2D.point.Point2Ddistort(org.jeometry.geom2D.point.Point2D undistorted, org.jeometry.geom2D.point.Point2D distorted)Distort theinputpoint and store the result withinoutputpoint.org.jeometry.math.VectorGet the distortion coefficients as avector.org.jeometry.math.VectorgetDistortionCoefficients(org.jeometry.math.Vector coefficients)Get the distortion coefficients as avectorby filling the givencoefficients.double[]Get the distortion coefficients as adoublearray.double[]getDistortionCoefficientsDouble(double[] coefficients)Get the distortion coefficients as adoublearray by filling the givencoefficients.float[]Get the distortion coefficients as afloatarray.float[]getDistortionCoefficientsFloat(float[] coefficients)Get the distortion coefficients as afloatarray by filling the givencoefficients.intGet the components of the distortion.Get the convention used by this lens distortion representation.voidsetDistortionCoefficients(double[] coefficients)Set the distortion coefficients from the givendoublearray.voidsetDistortionCoefficients(float[] coefficients)Set the distortion coefficients from the givenfloatarray.voidsetDistortionCoefficients(org.jeometry.math.Vector coefficients)Set the distortion coefficients from the givenvector.org.jeometry.geom2D.point.Point2Dundistort(org.jeometry.geom2D.point.Point2D distorted)Undistort the given point.org.jeometry.geom2D.point.Point2Dundistort(org.jeometry.geom2D.point.Point2D distorted, org.jeometry.geom2D.point.Point2D undistorted)Undistort theinputpoint and store the result withinoutputpoint.
-
Field Details
-
TYPE_NO_DISTORTION
static final int TYPE_NO_DISTORTIONA flag that indicates that the lens has no distortion distortion. -
TYPE_RADIAL_SIMPLE
static final int TYPE_RADIAL_SIMPLEA flag that indicates that the radial distortion has a simple component. -
TYPE_RADIAL_RATIONAL
static final int TYPE_RADIAL_RATIONALA flag that indicates that the radial distortion has a rational component. -
TYPE_RADIAL
static final int TYPE_RADIALA flag that indicates that the distortion has a radial component (that can be simple, radial or both). -
TYPE_TANGENTIAL
static final int TYPE_TANGENTIALA flag that indicates that the distortion has a tangential (decentering) component. -
TYPE_PRISM
static final int TYPE_PRISMA flag that indicates that the distortion has a prism component. -
TYPE_TILT
static final int TYPE_TILTA flag that indicates that the distortion has a tilt component.
-
-
Method Details
-
getDistortionConvention
String getDistortionConvention()Get the convention used by this lens distortion representation.- Returns:
- the convention used by this lens distortion representation.
-
getDistortionComponents
int getDistortionComponents()Get the components of the distortion. The returned value is a logical combination ofTYPE_RADIAL_SIMPLE,TYPE_RADIAL_RATIONAL,TYPE_TANGENTIAL,TYPE_PRISMorTYPE_TILT.- Returns:
- the components of the distortion
-
distort
org.jeometry.geom2D.point.Point2D distort(org.jeometry.geom2D.point.Point2D undistorted)Distort the given point. The point have to be expressed within camera coordinates. If the input isnull, coordinates of the result are set toDouble.NaN.- Parameters:
undistorted- the input point within camera coordinates.- Returns:
- the distorted point.
- See Also:
undistort(Point2D)
-
distort
org.jeometry.geom2D.point.Point2D distort(org.jeometry.geom2D.point.Point2D undistorted, org.jeometry.geom2D.point.Point2D distorted)Distort theinputpoint and store the result withinoutputpoint. The point have to be expressed within camera coordinates. If the input isnull, coordinates of the result are set toDouble.NaN.- Parameters:
undistorted- the input point within camera coordinates.distorted- the output point within camera coordinates.- Returns:
- the distorted point (same reference as
outputif its notnull). - See Also:
undistort(Point2D, Point2D)
-
undistort
org.jeometry.geom2D.point.Point2D undistort(org.jeometry.geom2D.point.Point2D distorted)Undistort the given point. The point have to be expressed within image coordinates. If the input isnull, coordinates of the result are set toDouble.NaN.- Parameters:
distorted- the input point within image coordinates.- Returns:
- the undistorted point.
- See Also:
distort(Point2D)
-
undistort
org.jeometry.geom2D.point.Point2D undistort(org.jeometry.geom2D.point.Point2D distorted, org.jeometry.geom2D.point.Point2D undistorted)Undistort theinputpoint and store the result withinoutputpoint. The point have to be expressed within image coordinates. If the input isnull, coordinates of the result are set toDouble.NaN.- Parameters:
distorted- the input point within image coordinates.undistorted- the output point within camera coordinates.- Returns:
- the undistorted point (same reference as
outputif its notnull). - See Also:
distort(Point2D, Point2D)
-
getDistortionCoefficients
org.jeometry.math.Vector getDistortionCoefficients()Get the distortion coefficients as avector. The dimension of the vector and the ordering of its components are defined by the underlying lens distortion implementation.- Returns:
- the distortion coefficients
-
getDistortionCoefficients
org.jeometry.math.Vector getDistortionCoefficients(org.jeometry.math.Vector coefficients) throws IllegalArgumentExceptionGet the distortion coefficients as avectorby filling the givencoefficients. The dimension of the given vector has to fit the underlying lens distortion implementation.- Parameters:
coefficients- the output vector that has to store distortion coefficients- Returns:
- a reference on the given vector, for chaining purposes
- Throws:
IllegalArgumentException- if the given vector does match the distortion implementation requirement
-
setDistortionCoefficients
void setDistortionCoefficients(org.jeometry.math.Vector coefficients) throws IllegalArgumentExceptionSet the distortion coefficients from the givenvector. The dimension of the vector and the ordering of its components are defined by the underlying lens distortion implementation.- Parameters:
coefficients- the distortion coefficients- Throws:
IllegalArgumentException- if the input vector does match the distortion implementation requirement
-
getDistortionCoefficientsFloat
float[] getDistortionCoefficientsFloat()Get the distortion coefficients as afloatarray. The dimension of the array and the ordering of its values are defined by the underlying lens distortion implementation.- Returns:
- the distortion coefficients
-
getDistortionCoefficientsFloat
Get the distortion coefficients as afloatarray by filling the givencoefficients. The dimension of the given array has to fit the underlying lens distortion implementation.- Parameters:
coefficients- the output array that has to store distortion coefficients- Returns:
- a reference on the given array, for chaining purposes
- Throws:
IllegalArgumentException- if the given array does match the distortion implementation requirement
-
setDistortionCoefficients
Set the distortion coefficients from the givenfloatarray. The dimension of the array and the ordering of its values are defined by the underlying lens distortion implementation.- Parameters:
coefficients- the distortion coefficients- Throws:
IllegalArgumentException- if the input array does match the distortion implementation requirement
-
getDistortionCoefficientsDouble
double[] getDistortionCoefficientsDouble()Get the distortion coefficients as adoublearray. The dimension of the array and the ordering of its values are defined by the underlying lens distortion implementation.- Returns:
- the distortion coefficients
-
getDistortionCoefficientsDouble
Get the distortion coefficients as adoublearray by filling the givencoefficients. The dimension of the given array has to fit the underlying lens distortion implementation.- Parameters:
coefficients- the output array that has to store distortion coefficients- Returns:
- a reference on the given array, for chaining purposes
- Throws:
IllegalArgumentException- if the given array does match the distortion implementation requirement
-
setDistortionCoefficients
Set the distortion coefficients from the givendoublearray. The dimension of the array and the ordering of its values are defined by the underlying lens distortion implementation.- Parameters:
coefficients- the distortion coefficients- Throws:
IllegalArgumentException- if the input array does match the distortion implementation requirement
-