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  Calibration.Type  
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected boolean swigCMemOwn  
  • Constructor Summary

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

    Modifier and Type Method Description
    void delete()  
    protected void finalize()  
    double getB1()
    Affinity.
    double getB2()
    Non-orthogonality.
    static long getCPtr​(Calibration obj)  
    double getCx()
    Principal point X coordinate.
    double getCy()
    Principal point Y coordinate.
    Vector2d getError​(Vector3d point, Vector2d proj)
    Return projection error.
    double getF()
    Focal length.
    long getHeight()
    Image height.
    double getK1()
    Radial distortion coefficient K1.
    double getK2()
    Radial distortion coefficient K2.
    double getK3()
    Radial distortion coefficient K3.
    double getK4()
    Radial distortion coefficient K4.
    double getP1()
    Decentering distortion coefficient P1.
    double getP2()
    Decentering distortion coefficiant P2.
    double getP3()
    Decentering distortion coefficient P3.
    double getP4()
    Decentering distortion coefficiant P4.
    RPCModel getRPCModel()
    RPC model.
    Calibration.Type getType()
    Camera model.
    long getWidth()
    Image width.
    void load​(String path, CalibrationFormat format)
    Load calibration from file.
    Vector2d 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 setRPCModel​(RPCModel rpc)
    RPC model.
    void setType​(Calibration.Type type)
    Camera model.
    void setWidth​(long width)
    Image width.
    Vector3d 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.