|
|
NVIDIA DRIVE OS Linux API Reference5.1.0.2 Release |
The NvMedia Lens Distortion Correction (LDC) API contains NvMedia functions for accessing the LDC hardware engine for geometric transform and temporal noise reduction (TNR3).
Data Structures | |
| struct | NvMediaCamIntriParams |
| Holds NvMedia camera intrinsic parameters. More... | |
| struct | NvMediaLensDistortion |
| Holds distortion coefficients for the lens model. More... | |
| struct | NvMediaCameraModel |
| Holds NvMedia LDC camera parameter info. More... | |
| struct | NvMediaLDCRegionConfig |
| Holds the NvMedia LDC region configuration. More... | |
| struct | NvMediaLDCBitMaskMap |
| Holds the NvMedia mask map surface. More... | |
| struct | NvMediaGeoTransParams |
| Holds geometric transform initialization paramters. More... | |
| struct | NvMediaTNR3Params |
| Holds the TNR3 initialization paramters. More... | |
| struct | NvMediaTNR2Params |
| Holds the TNR2 initialization paramters. More... | |
| struct | NvMediaLDCInitParams |
| Holds the NvMedia LDC initialization paramters. More... | |
| struct | NvMediaLDCSparseWarpMap |
| Holds the NvMedia LDC defintion of Sparse warp map. More... | |
| struct | NvMediaLDCCtrlParams |
| Holds runtime control parameters for NvMediaLDCProcess(). More... | |
Macros | |
| #define | NVMEDIA_LDC_VERSION_MAJOR 1 |
| Defines the major version number. More... | |
| #define | NVMEDIA_LDC_VERSION_MINOR 2 |
| Defines the minor version number. More... | |
| #define | NVMEDIA_LDC_MAX_HOR_REGION 4 |
| Defines the maximum number of horizontal regions. More... | |
| #define | NVMEDIA_LDC_MAX_VER_REGION 4 |
| Defines the aximum number of vertical regions. More... | |
| #define | NVMEDIA_LDC_MIN_REGION_WIDTH 64 |
| Defines the minimum width of horizontal and vertical regions. More... | |
| #define | NVMEDIA_LDC_MIN_REGION_HEIGHT 16 |
| Defines the minimum height of horizontal and vertical regions. More... | |
Typedefs | |
| typedef struct NvMediaLDC | NvMediaLDC |
| Defines the NvMedia LDC handle as an opaque struct. More... | |
Functions | |
| NvMediaStatus | NvMediaLDCGetVersion (NvMediaVersion *version) |
| Returns the version information of NvMedia LDC. More... | |
| NvMediaStatus | NvMediaLDCCreate (NvMediaLDC **pldc, const uint16_t srcWidth, const uint16_t srcHeight, const NvMediaRect *srcRect, const uint16_t dstWidth, const uint16_t dstHeight, const NvMediaRect *dstRect, const NvMediaLDCInitParams *initParams) |
| Creates an NvMedia LDC handle. More... | |
| NvMediaStatus | NvMediaLDCDestroy (NvMediaLDC *ldc) |
| Destroys the NvMedia LDC handle that was created by NvMediaLDCCreate(). More... | |
| NvMediaStatus | NvMediaLDCFeedSparseWarpMap (NvMediaLDC *ldc, const NvMediaLDCSparseWarpMap *map) |
| Feeds sparse warp map to NvMedia LDC. More... | |
| NvMediaStatus | NvMediaLDCMappingGen (NvMediaLDC *ldc) |
| Generates sparse warp mapping based on NvMediaCameraModel. More... | |
| NvMediaStatus | NvMediaLDCUpdateTNR3Params (NvMediaLDC *ldc, const NvMediaTNR3Params *tnr3Params) |
| Updates TNR3 parameters after NvMediaLDCCreate(). More... | |
| NvMediaStatus | NvMediaLDCProcess (NvMediaLDC *ldc, NvMediaImage *prevSurface, NvMediaImage *curSurface, NvMediaImage *outputSurface, NvMediaImage *xSobel, NvMediaImage *downSample, const NvMediaLDCCtrlParams *ldcCtrlParams) |
| Performs the specified LDC operation. More... | |
| #define NVMEDIA_LDC_MAX_HOR_REGION 4 |
Defines the maximum number of horizontal regions.
Definition at line 48 of file nvmedia_ldc.h.
| #define NVMEDIA_LDC_MAX_VER_REGION 4 |
Defines the aximum number of vertical regions.
Definition at line 51 of file nvmedia_ldc.h.
| #define NVMEDIA_LDC_MIN_REGION_HEIGHT 16 |
Defines the minimum height of horizontal and vertical regions.
Definition at line 57 of file nvmedia_ldc.h.
| #define NVMEDIA_LDC_MIN_REGION_WIDTH 64 |
Defines the minimum width of horizontal and vertical regions.
Definition at line 54 of file nvmedia_ldc.h.
| #define NVMEDIA_LDC_VERSION_MAJOR 1 |
Defines the major version number.
Definition at line 38 of file nvmedia_ldc.h.
| #define NVMEDIA_LDC_VERSION_MINOR 2 |
Defines the minor version number.
Definition at line 40 of file nvmedia_ldc.h.
| typedef struct NvMediaLDC NvMediaLDC |
Defines the NvMedia LDC handle as an opaque struct.
Definition at line 45 of file nvmedia_ldc.h.
| enum NvMediaGeoTransMode |
Defines geometric transform operate modes.
| Enumerator | |
|---|---|
| NVMEDIA_GEOTRANS_MODE_GEN_MAPPING |
Specifies to generate sparse warp map for geometric transform. |
| NVMEDIA_GEOTRANS_MODE_FEED_MAPPING |
Specifies to take sparse warp map from client via NvMediaLDCFeedSparseWarpMap(). |
| NVMEDIA_GEOTRANS_MODE_AFFINE_TRANSFORM |
Specifies to do affine transform. |
| NVMEDIA_GEOTRANS_MODE_PERSPECTIVE_TRANSFORM |
Specifies to do perspective transform. |
Definition at line 79 of file nvmedia_ldc.h.
| enum NvMediaLDCDataFormat |
Defines the NvMedia LDC Data Format.
Definition at line 518 of file nvmedia_ldc.h.
| enum NvMediaLDCMode |
Defines the NvMedia LDC operating modes.
Definition at line 62 of file nvmedia_ldc.h.
| enum NvMediaLDCSobelMode |
Defines the xSobel working modes.
Definition at line 561 of file nvmedia_ldc.h.
| enum NvMediaLensModel |
Defines supported lens models.
Definition at line 97 of file nvmedia_ldc.h.
| NvMediaStatus NvMediaLDCCreate | ( | NvMediaLDC ** | pldc, |
| const uint16_t | srcWidth, | ||
| const uint16_t | srcHeight, | ||
| const NvMediaRect * | srcRect, | ||
| const uint16_t | dstWidth, | ||
| const uint16_t | dstHeight, | ||
| const NvMediaRect * | dstRect, | ||
| const NvMediaLDCInitParams * | initParams | ||
| ) |
Creates an NvMedia LDC handle.
The function creates and initializes the appropriate internal infrastructure for LDC/TNR3 depending on the input arguments. A valid NvMedia LDC handle is returned if successful.
| [out] | pldc | An indirect pointer to the NvMediaLDC handle. |
| [in] | srcWidth | Width of the source image. |
| [in] | srcHeight | Height of the source image. |
| [in] | srcRect | Structure containing co-ordinates of the rectangle in the source image. Setting srcRect to NULL implies rectangle of full source image size. |
| [in] | dstWidth | Width of the destination image. |
| [in] | dstHeight | Height of the destination image. |
| [in] | dstRect | Structure containing co-ordinates of the rectangle in the destination image. Setting dstRect to NULL implies rectangle of full destination image size. |
| [in] | initParams | Initialization parameters of LDC creation. See NvMediaLDCInitParams. |
| NvMediaStatus NvMediaLDCDestroy | ( | NvMediaLDC * | ldc | ) |
Destroys the NvMedia LDC handle that was created by NvMediaLDCCreate().
Frees up the internal resources and handles allocated during NvMediaLDCCreate().
| [in] | ldc | Handle to the current context, previously returned by NvMediaLDCCreate(). |
| NvMediaStatus NvMediaLDCFeedSparseWarpMap | ( | NvMediaLDC * | ldc, |
| const NvMediaLDCSparseWarpMap * | map | ||
| ) |
Feeds sparse warp map to NvMedia LDC.
Must be called when NvMediaGeoTransMode is NVMEDIA_GEOTRANS_MODE_FEED_MAPPING. The sparse warp map must match the NvMediaLDCRegionConfig.
| [in] | ldc | Handle to the current context, previously returned by NvMediaLDCCreate(). |
| [in] | map | Client-specified sparse warp map, NvMediaLDCSparseWarpMap. |
| NvMediaStatus NvMediaLDCGetVersion | ( | NvMediaVersion * | version | ) |
Returns the version information of NvMedia LDC.
| [in] | version | A pointer to a NvMediaVersion structure filled by the NvMedia LDC. |
| NvMediaStatus NvMediaLDCMappingGen | ( | NvMediaLDC * | ldc | ) |
Generates sparse warp mapping based on NvMediaCameraModel.
Must be called when NvMediaGeoTransMode is NVMEDIA_GEOTRANS_MODE_GEN_MAPPING. This is a CPU-based operation.
| [in] | ldc | Handle to the current context, previously returned by NvMediaLDCCreate(). |
| NvMediaStatus NvMediaLDCProcess | ( | NvMediaLDC * | ldc, |
| NvMediaImage * | prevSurface, | ||
| NvMediaImage * | curSurface, | ||
| NvMediaImage * | outputSurface, | ||
| NvMediaImage * | xSobel, | ||
| NvMediaImage * | downSample, | ||
| const NvMediaLDCCtrlParams * | ldcCtrlParams | ||
| ) |
Performs the specified LDC operation.
LDC performs transformations depending onthe GEO mode:
If NvMediaLDCInitParams::ldcMode is NVMEDIA_LDC_MODE_TNR3 or NVMEDIA_LDC_MODE_GEOTRANS_TNR3, LDC performs temporal noise reduction.
NvMediaLDCProcess() is a non-blocking call.
NvMediaImageGetStatus() can be used to check the status of input/output images.
| [in] | ldc | NvMediaLDC Handle obtained by call to NvMediaLDCCreate(). |
| [in] | prevSurface | A pointer to the previous image output. Used only when NvMediaLDCInitParams::ldcMode is NVMEDIA_LDC_MODE_GEOTRANS_TNR3 or NVMEDIA_LDC_MODE_TNR3. |
| [in] | curSurface | A pointer to the source image. |
| [in,out] | outputSurface | A pointer to the output image. Caller must create this surface. |
| [in,out] | xSobel | A pointer to the xSobel image output. Caller must create this surface. |
| [in,out] | downSample | A pointer to the downsampled image output. Caller must create this surface. |
| [in] | ldcCtrlParams | A pointer to run-time control parameters. |
| NvMediaStatus NvMediaLDCUpdateTNR3Params | ( | NvMediaLDC * | ldc, |
| const NvMediaTNR3Params * | tnr3Params | ||
| ) |
Updates TNR3 parameters after NvMediaLDCCreate().
NvMediaLDCCreate() initializes NvMediaLDC with TNR3 parameters specified as part of NvMediaLDCInitParams. If necessary, this function can be used to update the TNR3 parameters.
| [in] | ldc | Handle to the current context, previously returned by NvMediaLDCCreate(). |
| [in] | tnr3Params | Pointer to object of type NvMediaTNR3Params. |