The 2D LDC (lens distortion correction) Utility Functions API offers a set of utility functions for working with LDC warp maps.
Data Structures | |
| struct | NvMedia2DLdcCameraIntrinsic |
| Instrinsic camera parameters. More... | |
| struct | NvMedia2DLdcCameraExtrinsic |
| Extrinsic camera parameters. More... | |
| struct | NvMedia2DLdcLensDistortion |
| Distortion coefficients for the lens model. More... | |
Enumerations | |
| enum | NvMedia2DLdcLensModel { NVMEDIA_2D_LDC_LENS_MODEL_POLYNOMIAL_DISTORTION, NVMEDIA_2D_LDC_LENS_MODEL_FISHEYE_EQUIDISTANT, NVMEDIA_2D_LDC_LENS_MODEL_FISHEYE_EQUISOLID, NVMEDIA_2D_LDC_LENS_MODEL_FISHEYE_ORTHOGRAPHIC, NVMEDIA_2D_LDC_LENS_MODEL_FISHEYE_STEREOGRAPHIC } |
| Supported lens models used to generate a Warp Map. More... | |
Functions | |
| NvMediaStatus | NvMedia2DGetNumLdcControlPoints (NvMedia2DLdcRegionParameters const *const regionParams, uint32_t *numControlPoints) |
| Helper function to calculate the number of control points from the defined sparse warp map region parameters. More... | |
| NvMediaStatus | NvMedia2DGenLdcWarpMapIdentity (NvMediaRect const *const dstRect, NvMedia2DLdcRegionParameters const *const regionParams, uint32_t numControlPoints, NvMedia2DLdcControlPoint *const controlPoints) |
| Helper function to fills the given warp map with an identity mapping. More... | |
| NvMediaStatus | NvMedia2DGenLdcWarpMap (NvMedia2DLdcCameraIntrinsic const *const Kin, NvMedia2DLdcCameraExtrinsic const *const X, NvMedia2DLdcCameraIntrinsic const *const Kout, NvMedia2DLdcLensDistortion const *const distModel, NvMediaRect const *const dstRect, NvMedia2DLdcRegionParameters const *const regionParams, uint32_t numControlPoints, NvMedia2DLdcControlPoint *const controlPoints) |
| Generates Warp Map for a particular lens model. More... | |
Supported lens models used to generate a Warp Map.
Usage considerations
Definition at line 43 of file nvmedia_2d_ldcutil.h.
| NvMediaStatus NvMedia2DGenLdcWarpMap | ( | NvMedia2DLdcCameraIntrinsic const *const | Kin, |
| NvMedia2DLdcCameraExtrinsic const *const | X, | ||
| NvMedia2DLdcCameraIntrinsic const *const | Kout, | ||
| NvMedia2DLdcLensDistortion const *const | distModel, | ||
| NvMediaRect const *const | dstRect, | ||
| NvMedia2DLdcRegionParameters const *const | regionParams, | ||
| uint32_t | numControlPoints, | ||
| NvMedia2DLdcControlPoint *const | controlPoints | ||
| ) |
Generates Warp Map for a particular lens model.
The result is valid only on the same HW platform where this function was called.
| [in] | Kin | Pointer to NvMedia2DLdcCameraIntrinsic parameters. |
| [in] | X | Pointer to NvMedia2DLdcCameraExtrinsic parameters. |
| [in] | Kout | Pointer to NvMedia2DLdcCameraIntrinsic parameters. |
| [in] | distModel | Pointer to NvMedia2DLdcLensDistortion struct. |
| [in] | dstRect | Pointer to the destination rectangle. |
| [in] | regionParams | Pointer to NvMedia2DLdcRegionParameters for Warp Map. |
| [in] | numControlPoints | Number of control points in Warp Map. |
| [in] | controlPoints | Pointer to the control points array. |
| NVMEDIA_STATUS_OK | Warp Map is successfully generated. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of parameters is invalid. This could be either:
|
| NVMEDIA_STATUS_NOT_SUPPORTED | Current HW platform is not supported. |
| NVMEDIA_STATUS_ERROR | An internal failure occurred. |
Usage considerations
| NvMediaStatus NvMedia2DGenLdcWarpMapIdentity | ( | NvMediaRect const *const | dstRect, |
| NvMedia2DLdcRegionParameters const *const | regionParams, | ||
| uint32_t | numControlPoints, | ||
| NvMedia2DLdcControlPoint *const | controlPoints | ||
| ) |
Helper function to fills the given warp map with an identity mapping.
This function is useful if the user wants to specify their own mapping. It sets the control points coordinates to the destination coordinates as defined implicitly by the NvMedia2DLdcRegionParameters. The user then can iterate through these points and apply a custom mapping function to each one.
The result is valid only on the same HW platform where this function was called.
| [in] | dstRect | Pointer to the destination rectangle. |
| [in] | regionParams | Pointer to NvMedia2DLdcRegionParameters for Warp Map. |
| [in] | numControlPoints | Number of control points in Warp Map. |
| [in] | controlPoints | Pointer to the control points array. |
| NVMEDIA_STATUS_OK | Warp Map was successfully configured. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of parameters is invalid. This could be either:
|
| NVMEDIA_STATUS_NOT_SUPPORTED | Current HW platform is not supported. |
| NVMEDIA_STATUS_ERROR | An internal failure occurred. |
Usage considerations
| NvMediaStatus NvMedia2DGetNumLdcControlPoints | ( | NvMedia2DLdcRegionParameters const *const | regionParams, |
| uint32_t * | numControlPoints | ||
| ) |
Helper function to calculate the number of control points from the defined sparse warp map region parameters.
The result is valid only on the same HW platform where this function was called.
| [in] | regionParams | Pointer to NvMedia2DLdcRegionParameters that contains parameters for regions of a Warp Map. |
| [out] | numControlPoints | Number of Control Points calculated. |
| NVMEDIA_STATUS_OK | Number of Control Points has been calculated successfully. |
| NVMEDIA_STATUS_BAD_PARAMETER | One of parameters is invalid. This could be either:
|
| NVMEDIA_STATUS_NOT_SUPPORTED | Current HW platform is not supported. |
| NVMEDIA_STATUS_ERROR | An internal failure occurred. |
Usage considerations