Calibration¶
- class Calibration(*args, **kwargs)¶
Bases:
pybind11_object
Tools for perspective camera calibration.
Overloaded function.
__init__(self: visp._visp.vision.Calibration) -> None
Default constructor.
__init__(self: visp._visp.vision.Calibration, c: visp._visp.vision.Calibration) -> None
Copy constructor.
Methods
Overloaded function.
Add a new point in the array of points.
Suppress all the point in the array of point.
Compute the calibration according to the desired method using one pose.
Compute the multi-images calibration according to the desired method using many poses.
Overloaded function.
Compute and return the standard deviation expressed in pixel for pose matrix and camera intrinsic parameters with pixel to meter model.
Display the data of the calibration (center of the tracked dots).
Display estimated centers of dots using intrinsic camera parameters with model with distortion and the computed pose.
Get the gain of the virtual visual servoing algorithm.
Get the residual in pixels.
Get the residual for perspective projection with distortion (in pixels).
Get the number of points.
Basic initialisation (called by the constructors).
Read data from disk : data are organized as follow oX oY oZ u v
Read calibration grid coordinates from disk.
Set pixel aspect ratio px/py.
Set the gain for the virtual visual servoing algorithm.
Write data into a file.
Inherited Methods
Operators
__doc__
Overloaded function.
__module__
Attributes
CALIB_LAGRANGE
CALIB_LAGRANGE_VIRTUAL_VS
CALIB_LAGRANGE_VIRTUAL_VS_DIST
CALIB_VIRTUAL_VS
CALIB_VIRTUAL_VS_DIST
__annotations__
aspect_ratio
cMo
cMo_dist
cam
cam_dist
eMc
eMc_dist
rMe
- class CalibrationMethodType(self, value: int)¶
Bases:
pybind11_object
Minimization algorithm use to estimate the camera parameters.
Values:
CALIB_LAGRANGE: Lagrange approach without estimation of the distortion.
CALIB_VIRTUAL_VS: Virtual visual servoing approach without estimation of the distortion (results are similar to Lowe approach).
CALIB_VIRTUAL_VS_DIST: Virtual visual servoing approach with estimation of the distortion.
CALIB_LAGRANGE_VIRTUAL_VS: Lagrange approach first, than virtual visual servoing approach, without estimation of the distortion.
CALIB_LAGRANGE_VIRTUAL_VS_DIST: Lagrange approach first, than virtual visual servoing approach, with estimation of the distortion.
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: visp._visp.vision.Calibration) -> None
Default constructor.
__init__(self: visp._visp.vision.Calibration, c: visp._visp.vision.Calibration) -> None
Copy constructor.
- addPoint(self, X: float, Y: float, Z: float, ip: visp._visp.core.ImagePoint) int ¶
Add a new point in the array of points.
- computeCalibration(self, method: visp._visp.vision.Calibration.CalibrationMethodType, cMo_est: visp._visp.core.HomogeneousMatrix, cam_est: visp._visp.core.CameraParameters, verbose: bool = false) int ¶
Compute the calibration according to the desired method using one pose.
- Parameters:
- method: visp._visp.vision.Calibration.CalibrationMethodType¶
Method that will be used to estimate the parameters.
- cMo_est: visp._visp.core.HomogeneousMatrix¶
estimated homogeneous matrix that defines the pose.
- cam_est: visp._visp.core.CameraParameters¶
estimated intrinsic camera parameters.
- verbose: bool = false¶
set at true if information about the residual at each loop of the algorithm is hoped.
- Returns:
EXIT_SUCCESS if the calibration succeed, EXIT_FAILURE otherwise.
- static computeCalibrationMulti(method: visp._visp.vision.Calibration.CalibrationMethodType, table_cal: list[visp._visp.vision.Calibration], cam_est: visp._visp.core.CameraParameters, globalReprojectionError: float, verbose: bool = false) tuple[int, list[visp._visp.vision.Calibration], float] ¶
Compute the multi-images calibration according to the desired method using many poses.
- Parameters:
- method: visp._visp.vision.Calibration.CalibrationMethodType¶
Method used to estimate the camera parameters.
- table_cal: list[visp._visp.vision.Calibration]¶
Vector of vpCalibration .
- cam_est: visp._visp.core.CameraParameters¶
Estimated intrinsic camera parameters.
- globalReprojectionError: float¶
Global reprojection error or global residual.
- verbose: bool = false¶
Set at true if information about the residual at each loop of the algorithm is hoped.
- Returns:
A tuple containing:
EXIT_SUCCESS if the calibration succeed, EXIT_FAILURE otherwise.
table_cal: Vector of vpCalibration .
globalReprojectionError: Global reprojection error or global residual.
- computeStdDeviation(*args, **kwargs)¶
Overloaded function.
computeStdDeviation(self: visp._visp.vision.Calibration, deviation: float, deviation_dist: float) -> tuple[float, float]
Compute and return the standard deviation expressed in pixel for pose matrix and camera intrinsic parameters.
- Parameters:
- deviation
the standard deviation computed for the model without distortion.
- deviation_dist
the standard deviation computed for the model with distortion.
- Returns:
A tuple containing:
deviation: the standard deviation computed for the model without distortion.
deviation_dist: the standard deviation computed for the model with distortion.
computeStdDeviation(self: visp._visp.vision.Calibration, cMo_est: visp._visp.core.HomogeneousMatrix, camera: visp._visp.core.CameraParameters) -> float
Compute and return the standard deviation expressed in pixel for pose matrix and camera intrinsic parameters for model without distortion.
- Parameters:
- cMo_est
the matrix that defines the pose to be tested.
- camera
camera intrinsic parameters to be tested.
- Returns:
the standard deviation by point of the error in pixel .
- computeStdDeviation_dist(self, cMo_est: visp._visp.core.HomogeneousMatrix, camera: visp._visp.core.CameraParameters) float ¶
Compute and return the standard deviation expressed in pixel for pose matrix and camera intrinsic parameters with pixel to meter model.
- Parameters:
- cMo_est: visp._visp.core.HomogeneousMatrix¶
the matrix that defines the pose to be tested.
- camera: visp._visp.core.CameraParameters¶
camera intrinsic parameters to be tested.
- Returns:
the standard deviation by point of the error in pixel .
- displayData(self, I: visp._visp.core.ImageGray, color: visp._visp.core.Color, thickness: int = 1, subsampling_factor: int = 1) int ¶
Display the data of the calibration (center of the tracked dots).
- Parameters:
- I: visp._visp.core.ImageGray¶
Image where to display data.
- color: visp._visp.core.Color¶
Color of the data.
- thickness: int = 1¶
Thickness of the displayed data.
- subsampling_factor: int = 1¶
Subsampling factor. Default value is 1. Admissible values are multiple of 2. Divide by this parameter the coordinates of the data points resulting from image processing.
- displayGrid(self, I: visp._visp.core.ImageGray, color: visp._visp.core.Color, thickness: int = 1, subsampling_factor: int = 1) int ¶
Display estimated centers of dots using intrinsic camera parameters with model with distortion and the computed pose.
- Parameters:
- I: visp._visp.core.ImageGray¶
Image where to display grid data.
- color: visp._visp.core.Color¶
Color of the data.
- thickness: int = 1¶
Thickness of the displayed data.
- subsampling_factor: int = 1¶
Subsampling factor. Default value is 1. Admissible values are multiple of 2. Divide by this parameter the values of the camera parameters.
- getResidual_dist(self) float ¶
Get the residual for perspective projection with distortion (in pixels).
- static readGrid(filename: str, n: int, oX: list[float], oY: list[float], oZ: list[float], verbose: bool = false) tuple[int, int, list[float], list[float], list[float]] ¶
Read calibration grid coordinates from disk. Data are organized as follow oX oY oZ
- Parameters:
- filename: str¶
Name of the file.
- n: int¶
Number of points in the calibration grid.
- oX: list[float]¶
List of oX coordinates.
- oY: list[float]¶
List of oY coordinates.
- oZ: list[float]¶
List of oZ coordinates.
- verbose: bool = false¶
Additional printings if true (number of points on the calibration grid and their respective coordinates in the object frame).
- Returns:
A tuple containing:
0 if success, -1 if an error occurs.
n: Number of points in the calibration grid.
oX: List of oX coordinates.
oY: List of oY coordinates.
oZ: List of oZ coordinates.
- setAspectRatio(self, aspect_ratio: float) None ¶
Set pixel aspect ratio px/py.