InternalParams
Internal (intrinsic) parameters of a camera or projector system
Represent the internal parameters of a camera or projector system, e.g.
sensor and lens characteristics of a pinhole camera model.
Category: Calibration
Base class: _BlipValue
Constructors
__init__(self)
Constructor using default values for 1080p HD, 1/2” sensor, f=15mm
Create a set of internal parameters of an optical system, e.g. a camera
or projector.
__init__(self, imgSize: Int2, focal: float, pixSize: Vec2, ppShift: Vec2)
Constructor for specifying most important parameters
Create a set of internal parameters of an optical system, e.g. a camera
or projector.
Note: The focal length, pixel size and focus distance must be specified in the
same unit (e.g. [m])!
Parameters:
- imgSize image width and height in [pixel]
- focal focal length of lens in [m]
- pixSize physical size of a single pixel on the sensor in [m] (implicitly pixel aspect ratio)
- ppShift horizontal and vertical shift of principal point on image plane in [pixel]
Methods
getAspectRatio(self) -> float
Get image aspect ratio
getFocalLengthPixels(self) -> Vec2
Get focal length in pixels
getFovX(self, bAdjustForFocus: bool) -> float
Calculate the horizontal field of view in [rad]
getFovY(self, bAdjustForFocus: bool) -> float
Calculate the vertical field of view in [rad]
getMatrix(self, verbose: int) -> Mat
Get the internal transformation matrix resulting in pixel coordinates
NOTE: This matrix does not contain perspective elements to divide by Z!
getPixelAspectRatio(self) -> float
Get pixel image aspect ratio
getPrincipalPoint(self) -> Vec2
Calculate the principal point position in [pixels]
getSensorAspectRatio(self) -> float
Get image sensor aspect ratio
getSensorSize(self) -> Vec2
Get full image sensor size in [m]
getThrowRatio(self) -> float
Calculate the throw ratio using focal length and sensor size: D/W = f/s_x
setIntrinsicMatrix(self, K: Mat, verbose: int) -> bool
Extract individual parameters from specified intrinsic matrix and set them
- Use the specified intrinsic matrix to extract individual parameters and then
set this objects parameter values to those derived from the matrix.
The following parameters are affected:
- focal length
- principal point shift
If the value extraction from the matrix failed, then no parameters are changed.
NOTE: This method uses getIntrinsicParameters() and assumes that the current
image size and sensor size stay the same!
Parameters:
- K 3x3 intrinsic matrix with new parameters
Returns returns ‘false’ if extraction from matrix K failed (not a valid intrinsic matrix)
setPrincipalPoint(self, ppointX: float, ppointY: float)
Set the position of the principal point in [pixels]
The principal point shift is modified according to the specified position
and the current image size.