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:
  • 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

    Fields
    Modifier and Type
    Field
    Description
    static int
    A flag that indicates that the lens has no distortion distortion.
    static int
    A flag that indicates that the distortion has a prism component.
    static int
    A flag that indicates that the distortion has a radial component (that can be simple, radial or both).
    static int
    A flag that indicates that the radial distortion has a rational component.
    static int
    A flag that indicates that the radial distortion has a simple component.
    static int
    A flag that indicates that the distortion has a tangential (decentering) component.
    static int
    A flag that indicates that the distortion has a tilt component.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.jeometry.geom2D.point.Point2D
    distort​(org.jeometry.geom2D.point.Point2D undistorted)
    Distort the given point.
    org.jeometry.geom2D.point.Point2D
    distort​(org.jeometry.geom2D.point.Point2D undistorted, org.jeometry.geom2D.point.Point2D distorted)
    Distort the input point and store the result within output point.
    org.jeometry.math.Vector
    Get the distortion coefficients as a vector.
    org.jeometry.math.Vector
    getDistortionCoefficients​(org.jeometry.math.Vector coefficients)
    Get the distortion coefficients as a vector by filling the given coefficients.
    double[]
    Get the distortion coefficients as a double array.
    double[]
    getDistortionCoefficientsDouble​(double[] coefficients)
    Get the distortion coefficients as a double array by filling the given coefficients.
    float[]
    Get the distortion coefficients as a float array.
    float[]
    getDistortionCoefficientsFloat​(float[] coefficients)
    Get the distortion coefficients as a float array by filling the given coefficients.
    int
    Get the components of the distortion.
    Get the convention used by this lens distortion representation.
    void
    setDistortionCoefficients​(double[] coefficients)
    Set the distortion coefficients from the given double array.
    void
    setDistortionCoefficients​(float[] coefficients)
    Set the distortion coefficients from the given float array.
    void
    setDistortionCoefficients​(org.jeometry.math.Vector coefficients)
    Set the distortion coefficients from the given vector.
    org.jeometry.geom2D.point.Point2D
    undistort​(org.jeometry.geom2D.point.Point2D distorted)
    Undistort the given point.
    org.jeometry.geom2D.point.Point2D
    undistort​(org.jeometry.geom2D.point.Point2D distorted, org.jeometry.geom2D.point.Point2D undistorted)
    Undistort the input point and store the result within output point.
  • Field Details

  • 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 of TYPE_RADIAL_SIMPLE, TYPE_RADIAL_RATIONAL, TYPE_TANGENTIAL, TYPE_PRISM or TYPE_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 is null, coordinates of the result are set to Double.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 the input point and store the result within output point. The point have to be expressed within camera coordinates. If the input is null, coordinates of the result are set to Double.NaN.
      Parameters:
      undistorted - the input point within camera coordinates.
      distorted - the output point within camera coordinates.
      Returns:
      the distorted point (same reference as output if its not null).
      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 is null, coordinates of the result are set to Double.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 the input point and store the result within output point. The point have to be expressed within image coordinates. If the input is null, coordinates of the result are set to Double.NaN.
      Parameters:
      distorted - the input point within image coordinates.
      undistorted - the output point within camera coordinates.
      Returns:
      the undistorted point (same reference as output if its not null).
      See Also:
      distort(Point2D, Point2D)
    • getDistortionCoefficients

      org.jeometry.math.Vector getDistortionCoefficients()
      Get the distortion coefficients as a vector. 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 IllegalArgumentException
      Get the distortion coefficients as a vector by filling the given coefficients. 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 IllegalArgumentException
      Set the distortion coefficients from the given vector. 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 a float array. The dimension of the array and the ordering of its values are defined by the underlying lens distortion implementation.
      Returns:
      the distortion coefficients
    • getDistortionCoefficientsFloat

      float[] getDistortionCoefficientsFloat(float[] coefficients) throws IllegalArgumentException
      Get the distortion coefficients as a float array by filling the given coefficients. 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

      void setDistortionCoefficients(float[] coefficients) throws IllegalArgumentException
      Set the distortion coefficients from the given float array. 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 a double array. The dimension of the array and the ordering of its values are defined by the underlying lens distortion implementation.
      Returns:
      the distortion coefficients
    • getDistortionCoefficientsDouble

      double[] getDistortionCoefficientsDouble(double[] coefficients) throws IllegalArgumentException
      Get the distortion coefficients as a double array by filling the given coefficients. 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

      void setDistortionCoefficients(double[] coefficients) throws IllegalArgumentException
      Set the distortion coefficients from the given double array. 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