API Reference#
Transformations#
The package pydistort provides a set of tools for camera distortion modeling and correction, primarily using OpenCV. It includes classes and functions to handle various types of distortion parameters.
The process to correspond a 3D-world point to a 2D-image point is as follows:
The
world_3dpoints
(\(X_W\)) are expressed in the camera coordinate system using the rotation and translation matrices to obtain thecamera_3dpoints
(\(X_C\)).The
camera_3dpoints
(\(X_C\)) are normalized by dividing by the third coordinate to obtain thenormalized_points
(\(x_N\)).The
normalized_points
(\(x_N\)) are distorted by the distortion model using the coefficients \(\{\lambda_1, \lambda_2, \lambda_3, \ldots\}\) to obtain thedistorted_points
(\(x_D\)).The
distorted_points
(\(x_D\)) are projected onto the image plane using the intrinsic matrix K to obtain theimage_points
(\(x_I\)).
To processing is performed by the following classes:
Transformation Classes:
Some distortion models are provided in the package, such as:
Distortion Models:
Global Functions#
The package also provides global functions for common tasks related to camera distortion and transformation. These functions are designed to simplify the process of applying transformations and corrections to camera images.
These functions are inspired by the OpenCV functions cv2.projectPoints and cv2.undistortPoints, but they are designed to work with the pydistort package’s classes and methods.