Data Structures | |
struct | VPIFisheyeLensDistortionModel |
Holds coefficients for fisheye lens distortion model. More... | |
struct | VPIPolynomialLensDistortionModel |
Holds coefficients for polynomial lens distortion model. More... | |
Typedefs | |
typedef float | VPICameraIntrinsic[2][3] |
Camera intrinsic matrix. More... | |
typedef float | VPICameraExtrinsic[3][4] |
Camera extrinsic matrix. More... | |
Enumerations | |
enum | VPIFisheyeMapping |
Supported fisheye lens mapping types. More... | |
Functions | |
VPIStatus | vpiWarpMapGenerateFromFisheyeLensDistortionModel (const VPICameraIntrinsic Kin, const VPICameraExtrinsic X, const VPICameraIntrinsic Kout, const VPIFisheyeLensDistortionModel *distModel, VPIWarpMap *warpMap) |
Generates a mapping that corrects image distortions caused by fisheye lenses. More... | |
VPIStatus | vpiWarpMapGenerateFromPolynomialLensDistortionModel (const VPICameraIntrinsic Kin, const VPICameraExtrinsic X, const VPICameraIntrinsic Kout, const VPIPolynomialLensDistortionModel *distModel, VPIWarpMap *warpMap) |
Generates a mapping that corrects image using polynomial lens distortion model. More... | |
struct VPIFisheyeLensDistortionModel |
Holds coefficients for fisheye lens distortion model.
The fisheye lens distortion model is defined by:
\begin{align*} r &= \sqrt{u^2 + v^2} \\ \theta &= \arctan(r) \\ r_d &= D(\theta + k_1 * \theta^3 + k_2 * \theta^5 + k_3 * \theta^7 + k_4 * \theta^9) \\ c_d &= r_d/r \\ u_d &= u*c_d \\ v_d &= v*c_d \end{align*}
where:
Definition at line 137 of file LensDistortionModels.h.
Data Fields | ||
---|---|---|
VPIFisheyeMapping | mapping |
Mapping between pixel angle and pixel distance to image center.
|
float | k1 |
Fisheye distortion coefficients. |
float | k2 |
Fisheye distortion coefficients. |
float | k3 |
Fisheye distortion coefficients. |
float | k4 |
Fisheye distortion coefficients. |
struct VPIPolynomialLensDistortionModel |
Holds coefficients for polynomial lens distortion model.
The polynomial lens distortion model is defined by:
\begin{align*} r &= \sqrt{u^2 + v^2} \\ k_r &= \frac{1 + k_1r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} \\ u_d &= k_r u + p_1(2uv) + p_2 * (r^2 + 2u^2) \\ v_d &= k_r v + p_1(r^2 + 2v^2) + p_2(2uv) \end{align*}
where:
Definition at line 215 of file LensDistortionModels.h.
typedef float VPICameraIntrinsic[2][3] |
#include </opt/nvidia/vpi2/include/vpi/Types.h>
Camera intrinsic matrix.
\begin{bmatrix} f_x & s & c_x \\ 0 & f_y & c_y \end{bmatrix}
Where:
typedef float VPICameraExtrinsic[3][4] |
#include </opt/nvidia/vpi2/include/vpi/Types.h>
Camera extrinsic matrix.
\begin{bmatrix} R_{3\times3} & T_{3\times1} \end{bmatrix}
Where: \(R_{3\times3}\): Rotation matrix. \(T_{3\times1}\): 3D position of the origin of world coordinate system expressed in coordinates of camera-centered system.
enum VPIFisheyeMapping |
#include </opt/nvidia/vpi2/include/vpi/LensDistortionModels.h>
Supported fisheye lens mapping types.
Definition at line 76 of file LensDistortionModels.h.
VPIStatus vpiWarpMapGenerateFromFisheyeLensDistortionModel | ( | const VPICameraIntrinsic | Kin, |
const VPICameraExtrinsic | X, | ||
const VPICameraIntrinsic | Kout, | ||
const VPIFisheyeLensDistortionModel * | distModel, | ||
VPIWarpMap * | warpMap | ||
) |
#include </opt/nvidia/vpi2/include/vpi/LensDistortionModels.h>
Generates a mapping that corrects image distortions caused by fisheye lenses.
Given camera intrinsic and extrinsic parameters, and fisheye lens distortion model, generates a VPIWarpMap suitable to be used by Remap to undistort images captured by cameras equipped with fisheye lens.
The mapping is defined by the following matrix equation:
\[ y = (K_{out} L X K_{in}) x \]
where:
[in] | Kin | Camera intrinsic parameters. |
[in] | X | Camera extrinsic parameters that defines the camera center position and its heading in world coordinates. |
[in] | Kout | New camera intrinsic parameters applied to the undistorted image. For monocular cameras, Kout is usually equal to Kin. |
[in] | distModel | Fisheye lens distortion model. |
[out] | warpMap | Resulting warp map that serves as input to Remap algorithm. |
VPI_ERROR_INVALID_ARGUMENT | warpMap is NULL. |
VPI_ERROR_INVALID_ARGUMENT | Kin is NULL. |
VPI_ERROR_INVALID_ARGUMENT | X is NULL. |
VPI_ERROR_INVALID_ARGUMENT | Output Kout is NULL. |
VPI_ERROR_INVALID_ARGUMENT | distModel is NULL. |
VPI_ERROR_INVALID_ARGUMENT | Fisheye model in distModel is invalid. |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiWarpMapGenerateFromPolynomialLensDistortionModel | ( | const VPICameraIntrinsic | Kin, |
const VPICameraExtrinsic | X, | ||
const VPICameraIntrinsic | Kout, | ||
const VPIPolynomialLensDistortionModel * | distModel, | ||
VPIWarpMap * | warpMap | ||
) |
#include </opt/nvidia/vpi2/include/vpi/LensDistortionModels.h>
Generates a mapping that corrects image using polynomial lens distortion model.
Given camera intrinsic and extrinsic parameters, and the polynomial lens distortion model, generates a VPIWarpMap suitable to be used by Remap to undistort images.
The mapping is defined by the following matrix equation:
\[ y = (K_{out} L X K_{in}) x \]
where:
[in] | Kin | Camera intrinsic parameters. |
[in] | X | Camera extrinsic parameters that defines the camera center position and its heading in world coordinates. |
[in] | Kout | New camera intrinsic parameters applied to the undistorted image. For monocular cameras, Kout is usually equal to Kin. |
[in] | distModel | Polynomial lens distortion model. |
[out] | warpMap | Resulting warp map that serves as input to Remap algorithm. |
VPI_ERROR_INVALID_ARGUMENT | warpMap is NULL. |
VPI_ERROR_INVALID_ARGUMENT | Kin is NULL. |
VPI_ERROR_INVALID_ARGUMENT | X is NULL. |
VPI_ERROR_INVALID_ARGUMENT | Output Kout is NULL. |
VPI_ERROR_INVALID_ARGUMENT | distModel is NULL. |
VPI_ERROR_INVALID_ARGUMENT | Polynomial model in distModel is invalid. |
VPI_SUCCESS | Operation executed successfully. |