Calibration

class Calibration(*args, **kwargs)

Bases: pybind11_object

Tools for perspective camera calibration.

Overloaded function.

  1. __init__(self: visp._visp.vision.Calibration) -> None

Default constructor.

  1. __init__(self: visp._visp.vision.Calibration, c: visp._visp.vision.Calibration) -> None

Copy constructor.

Methods

__init__

Overloaded function.

addPoint

Add a new point in the array of points.

clearPoint

Suppress all the point in the array of point.

computeCalibration

Compute the calibration according to the desired method using one pose.

computeCalibrationMulti

Compute the multi-images calibration according to the desired method using many poses.

computeStdDeviation

Overloaded function.

computeStdDeviation_dist

Compute and return the standard deviation expressed in pixel for pose matrix and camera intrinsic parameters with pixel to meter model.

displayData

Display the data of the calibration (center of the tracked dots).

displayGrid

Display estimated centers of dots using intrinsic camera parameters with model with distortion and the computed pose.

getLambda

Get the gain of the virtual visual servoing algorithm.

getResidual

Get the residual in pixels.

getResidual_dist

Get the residual for perspective projection with distortion (in pixels).

get_npt

Get the number of points.

init

Basic initialisation (called by the constructors).

readData

Read data from disk : data are organized as follow oX oY oZ u v

readGrid

Read calibration grid coordinates from disk.

setAspectRatio

Set pixel aspect ratio px/py.

setLambda

Set the gain for the virtual visual servoing algorithm.

writeData

Write data into a file.

Inherited Methods

Operators

__doc__

__init__

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.

__and__(self, other: object) object
__eq__(self, other: object) bool
__ge__(self, other: object) bool
__getstate__(self) int
__gt__(self, other: object) bool
__hash__(self) int
__index__(self) int
__init__(self, value: int)
__int__(self) int
__invert__(self) object
__le__(self, other: object) bool
__lt__(self, other: object) bool
__ne__(self, other: object) bool
__or__(self, other: object) object
__rand__(self, other: object) object
__ror__(self, other: object) object
__rxor__(self, other: object) object
__setstate__(self, state: int) None
__xor__(self, other: object) object
property name : str
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: visp._visp.vision.Calibration) -> None

Default constructor.

  1. __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.

Parameters:
X: float

3D coordinates of a point in the object frame

Y: float

3D coordinates of a point in the object frame

Z: float

3D coordinates of a point in the object frame

ip: visp._visp.core.ImagePoint

2D Coordinates of the point in the camera frame.

clearPoint(self) int

Suppress all the point in the array of point.

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.

  1. 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.

  1. 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.

static getLambda() float

Get the gain of the virtual visual servoing algorithm.

getResidual(self) float

Get the residual in pixels.

getResidual_dist(self) float

Get the residual for perspective projection with distortion (in pixels).

get_npt(self) int

Get the number of points.

init(self) int

Basic initialisation (called by the constructors).

readData(self, filename: str) int

Read data from disk : data are organized as follow oX oY oZ u v

Parameters:
filename: str

Name of the file.

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.

Parameters:
aspect_ratio: float

px/py aspect ratio. Value need to be positive. To estimate a model where px=py set 1 as aspect ratio.

static setLambda(lambda: float) None

Set the gain for the virtual visual servoing algorithm.

writeData(self, filename: str) int

Write data into a file.

Data are organized as follow oX oY oZ u v

Parameters:
filename: str

Name of the file.