Class Calibration

java.lang.Object
com.agisoft.metashape.Calibration

public class Calibration extends Object
Calibration object contains camera calibration information including image size,
focal length, principal point coordinates and distortion coefficients.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    Calibration​(long cPtr, boolean cMemoryOwn)
     
    Calibration​(Calibration calibration)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected void
     
    double
    Affinity.
    double
    Non-orthogonality.
    static long
     
    double
    Principal point X coordinate.
    double
    Principal point Y coordinate.
    getError​(Vector3d point, Vector2d proj)
    Return projection error.
    double
    Focal length.
    long
    Image height.
    double
    Radial distortion coefficient K1.
    double
    Radial distortion coefficient K2.
    double
    Radial distortion coefficient K3.
    double
    Radial distortion coefficient K4.
    double
    Decentering distortion coefficient P1.
    double
    Decentering distortion coefficiant P2.
    double
    Decentering distortion coefficient P3.
    double
    Decentering distortion coefficiant P4.
    RPC model.
    Camera model.
    long
    Image width.
    void
    load​(String path, CalibrationFormat format)
    Load calibration from file.
    project​(Vector3d point)
    Return projected pixel coordinates of the point.
    void
    save​(String path, CalibrationFormat format, String label, Vector2d pixel_size, double focal_length, double cx, double cy)
    Save calibration to file.
    void
    setB1​(double value)
    Affinity.
    void
    setB2​(double value)
    Non-orthogonality.
    void
    setCx​(double value)
    Principal point X coordinate.
    void
    setCy​(double value)
    Principal point Y coordinate.
    void
    setF​(double value)
    Focal length.
    void
    setHeight​(long height)
    Image height.
    void
    setK1​(double value)
    Radial distortion coefficient K1.
    void
    setK2​(double value)
    Radial distortion coefficient K2.
    void
    setK3​(double value)
    Radial distortion coefficient K3.
    void
    setK4​(double value)
    Radial distortion coefficient K4.
    void
    setP1​(double value)
    Decentering distortion coefficient P1.
    void
    setP2​(double value)
    Decentering distortion coefficiant P2.
    void
    setP3​(double value)
    Decentering distortion coefficient P3.
    void
    setP4​(double value)
    Decentering distortion coefficiant P4.
    void
    RPC model.
    void
    Camera model.
    void
    setWidth​(long width)
    Image width.
    unproject​(Vector2d point)
    Return direction corresponding to the image point.

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • swigCMemOwn

      protected transient boolean swigCMemOwn
  • Constructor Details

    • Calibration

      public Calibration​(long cPtr, boolean cMemoryOwn)
    • Calibration

      public Calibration()
    • Calibration

      public Calibration​(Calibration calibration)
  • Method Details

    • getCPtr

      public static long getCPtr​(Calibration obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • delete

      public void delete()
    • getType

      public Calibration.Type getType()
      Camera model.
    • getWidth

      public long getWidth()
      Image width.
    • getHeight

      public long getHeight()
      Image height.
    • setType

      public void setType​(Calibration.Type type)
      Camera model.
    • setWidth

      public void setWidth​(long width)
      Image width.
    • setHeight

      public void setHeight​(long height)
      Image height.
    • setF

      public void setF​(double value)
      Focal length.
    • getF

      public double getF()
      Focal length.
    • setCx

      public void setCx​(double value)
      Principal point X coordinate.
    • getCx

      public double getCx()
      Principal point X coordinate.
    • setCy

      public void setCy​(double value)
      Principal point Y coordinate.
    • getCy

      public double getCy()
      Principal point Y coordinate.
    • setB1

      public void setB1​(double value)
      Affinity.
    • getB1

      public double getB1()
      Affinity.
    • setB2

      public void setB2​(double value)
      Non-orthogonality.
    • getB2

      public double getB2()
      Non-orthogonality.
    • setK1

      public void setK1​(double value)
      Radial distortion coefficient K1.
    • getK1

      public double getK1()
      Radial distortion coefficient K1.
    • setK2

      public void setK2​(double value)
      Radial distortion coefficient K2.
    • getK2

      public double getK2()
      Radial distortion coefficient K2.
    • setK3

      public void setK3​(double value)
      Radial distortion coefficient K3.
    • getK3

      public double getK3()
      Radial distortion coefficient K3.
    • setK4

      public void setK4​(double value)
      Radial distortion coefficient K4.
    • getK4

      public double getK4()
      Radial distortion coefficient K4.
    • setP1

      public void setP1​(double value)
      Decentering distortion coefficient P1.
    • getP1

      public double getP1()
      Decentering distortion coefficient P1.
    • setP2

      public void setP2​(double value)
      Decentering distortion coefficiant P2.
    • getP2

      public double getP2()
      Decentering distortion coefficiant P2.
    • setP3

      public void setP3​(double value)
      Decentering distortion coefficient P3.
    • getP3

      public double getP3()
      Decentering distortion coefficient P3.
    • setP4

      public void setP4​(double value)
      Decentering distortion coefficiant P4.
    • getP4

      public double getP4()
      Decentering distortion coefficiant P4.
    • setRPCModel

      public void setRPCModel​(RPCModel rpc)
      RPC model.
    • getRPCModel

      public RPCModel getRPCModel()
      RPC model.
    • save

      public void save​(String path, CalibrationFormat format, String label, Vector2d pixel_size, double focal_length, double cx, double cy)
      Save calibration to file.
      Parameters:
      path - path to calibration file.
      format - Calibration format.
      label - Calibration label used in Australis, CalibCam and CalCam formats.
      pixel_size - Pixel size in mm used to convert normalized calibration coefficients to Australis and CalibCam coefficients.
      focal_length - Focal length (Grid calibration format only).
      cx - X principal point coordinate (Grid calibration format only).
      cy - Y principal point coordinate (Grid calibration format only).
    • load

      public void load​(String path, CalibrationFormat format)
      Load calibration from file.
      Parameters:
      path - Path to calibration file.
      format - Calibration format.
    • project

      public Vector2d project​(Vector3d point)
      Return projected pixel coordinates of the point.
      Parameters:
      point - Coordinates of the point to be projected.
      Returns:
      2D projected point coordinates.
    • unproject

      public Vector3d unproject​(Vector2d point)
      Return direction corresponding to the image point.
      Parameters:
      point - Pixel coordinates of the point.
      Returns:
      3D vector in the camera coordinate system.
    • getError

      public Vector2d getError​(Vector3d point, Vector2d proj)
      Return projection error.
      Parameters:
      point - Coordinates of the point to be projected.
      proj - Pixel coordinates of the point.
      Returns:
      2D projection error.