Package com.agisoft.metashape
Class Calibration
java.lang.Object
com.agisoft.metashape.Calibration
Calibration object contains camera calibration information including image size,
focal length, principal point coordinates and distortion coefficients.
focal length, principal point coordinates and distortion coefficients.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCalibration(long cPtr, boolean cMemoryOwn) Calibration(Calibration calibration) -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()protected voidfinalize()doublegetB1()Affinity.doublegetB2()Non-orthogonality.static longgetCPtr(Calibration obj) doublegetCx()Principal point X coordinate.doublegetCy()Principal point Y coordinate.Return projection error.doublegetF()Focal length.longImage height.doublegetK1()Radial distortion coefficient K1.doublegetK2()Radial distortion coefficient K2.doublegetK3()Radial distortion coefficient K3.doublegetK4()Radial distortion coefficient K4.doublegetP1()Decentering distortion coefficient P1.doublegetP2()Decentering distortion coefficiant P2.doublegetP3()Decentering distortion coefficient P3.doublegetP4()Decentering distortion coefficiant P4.RPC model.getType()Camera model.longgetWidth()Image width.voidload(String path, CalibrationFormat format) Load calibration from file.Return projected pixel coordinates of the point.voidsave(String path, CalibrationFormat format, String label, Vector2d pixel_size, double focal_length, double cx, double cy) Save calibration to file.voidsetB1(double value) Affinity.voidsetB2(double value) Non-orthogonality.voidsetCx(double value) Principal point X coordinate.voidsetCy(double value) Principal point Y coordinate.voidsetF(double value) Focal length.voidsetHeight(long height) Image height.voidsetK1(double value) Radial distortion coefficient K1.voidsetK2(double value) Radial distortion coefficient K2.voidsetK3(double value) Radial distortion coefficient K3.voidsetK4(double value) Radial distortion coefficient K4.voidsetP1(double value) Decentering distortion coefficient P1.voidsetP2(double value) Decentering distortion coefficiant P2.voidsetP3(double value) Decentering distortion coefficient P3.voidsetP4(double value) Decentering distortion coefficiant P4.voidsetRPCModel(RPCModel rpc) RPC model.voidsetType(Calibration.Type type) Camera model.voidsetWidth(long width) Image width.Return direction corresponding to the image point.
-
Field Details
-
swigCMemOwn
protected transient boolean swigCMemOwn
-
-
Constructor Details
-
Calibration
public Calibration(long cPtr, boolean cMemoryOwn) -
Calibration
public Calibration() -
Calibration
-
-
Method Details
-
getCPtr
-
finalize
protected void finalize() -
delete
public void delete() -
getType
Camera model. -
getWidth
public long getWidth()Image width. -
getHeight
public long getHeight()Image height. -
setType
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
RPC model. -
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
Load calibration from file.- Parameters:
path- Path to calibration file.format- Calibration format.
-
project
Return projected pixel coordinates of the point.- Parameters:
point- Coordinates of the point to be projected.- Returns:
- 2D projected point coordinates.
-
unproject
Return direction corresponding to the image point.- Parameters:
point- Pixel coordinates of the point.- Returns:
- 3D vector in the camera coordinate system.
-
getError
Return projection error.- Parameters:
point- Coordinates of the point to be projected.proj- Pixel coordinates of the point.- Returns:
- 2D projection error.
-