![]() |
NVIDIA DRIVE OS Linux SDK API Reference5.1.6.0 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 a sparse warp map. More... | |
struct | NvMediaLDCCtrlParams |
Holds runtime control parameters for NvMediaLDCProcess(). More... | |
Macros | |
#define | NVMEDIA_LDC_VERSION_MAJOR 2 |
Major version number. More... | |
#define | NVMEDIA_LDC_VERSION_MINOR 0 |
Minor version number. More... | |
#define | NVMEDIA_LDC_MAX_HOR_REGION 4u |
Maximum number of horizontal regions. More... | |
#define | NVMEDIA_LDC_MAX_VER_REGION 4u |
Maximum number of vertical regions. More... | |
#define | NVMEDIA_LDC_MIN_REGION_WIDTH 64u |
Minimum width of horizontal and vertical regions. More... | |
#define | NVMEDIA_LDC_MIN_REGION_HEIGHT 16u |
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 | NvMediaLDCCreateNew (const NvMediaDevice *device, 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 an NvMedia LDC handle that was created by a call to NvMediaLDCCreateNew(). More... | |
NvMediaStatus | NvMediaLDCFeedSparseWarpMap (NvMediaLDC *ldc, const NvMediaLDCSparseWarpMap *map) |
Feeds a sparse warp map to NvMedia LDC. More... | |
NvMediaStatus | NvMediaLDCMappingGen (NvMediaLDC *ldc) |
Generates a sparse warp mapping based on NvMediaCameraModel. More... | |
NvMediaStatus | NvMediaLDCUpdateTNR3Params (const NvMediaLDC *ldc, const NvMediaTNR3Params *tnr3Params) |
Updates TNR3 parameters after a call to NvMediaLDCCreateNew(). More... | |
NvMediaStatus | NvMediaLDCProcess (const NvMediaLDC *ldc, NvMediaImage *prevSurface, NvMediaImage *curSurface, NvMediaImage *outputSurface, NvMediaImage *xSobel, NvMediaImage *downSample, const NvMediaLDCCtrlParams *ldcCtrlParams) |
Performs a specified LDC operation. More... | |
#define NVMEDIA_LDC_MAX_HOR_REGION 4u |
Maximum number of horizontal regions.
Definition at line 50 of file nvmedia_ldc.h.
#define NVMEDIA_LDC_MAX_VER_REGION 4u |
Maximum number of vertical regions.
Definition at line 53 of file nvmedia_ldc.h.
#define NVMEDIA_LDC_MIN_REGION_HEIGHT 16u |
Minimum height of horizontal and vertical regions.
Definition at line 59 of file nvmedia_ldc.h.
#define NVMEDIA_LDC_MIN_REGION_WIDTH 64u |
Minimum width of horizontal and vertical regions.
Definition at line 56 of file nvmedia_ldc.h.
#define NVMEDIA_LDC_VERSION_MAJOR 2 |
Major version number.
Definition at line 40 of file nvmedia_ldc.h.
#define NVMEDIA_LDC_VERSION_MINOR 0 |
Minor version number.
Definition at line 42 of file nvmedia_ldc.h.
typedef struct NvMediaLDC NvMediaLDC |
Defines the NvMedia LDC handle as an opaque struct.
Definition at line 47 of file nvmedia_ldc.h.
enum NvMediaGeoTransMode |
Defines geometric transform operation modes.
Enumerator | |
---|---|
NVMEDIA_GEOTRANS_MODE_GEN_MAPPING |
Specifies generating a sparse warp map for geometric transform. |
NVMEDIA_GEOTRANS_MODE_FEED_MAPPING |
Specifies taking a sparse warp map from client via NvMediaLDCFeedSparseWarpMap(). |
NVMEDIA_GEOTRANS_MODE_AFFINE_TRANSFORM |
Specifies performing an affine transform. |
NVMEDIA_GEOTRANS_MODE_PERSPECTIVE_TRANSFORM |
Specifies performing a perspective transform. |
Definition at line 82 of file nvmedia_ldc.h.
enum NvMediaLDCDataFormat |
Defines the NvMedia LDC Data Format.
Definition at line 531 of file nvmedia_ldc.h.
enum NvMediaLDCMode |
Defines the NvMedia LDC operating modes.
Definition at line 64 of file nvmedia_ldc.h.
enum NvMediaLDCSobelMode |
Defines the xSobel working modes.
Definition at line 576 of file nvmedia_ldc.h.
enum NvMediaLensModel |
Defines supported lens models.
Definition at line 100 of file nvmedia_ldc.h.
NvMediaStatus NvMediaLDCCreateNew | ( | const NvMediaDevice * | device, |
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 or TNR3, depending on the input arguments. It returns a valid NvMedia LDC handle if successful.
[in] | device | An NvMediaDevice handle. |
[out] | pldc | A pointer to an LDC handle. |
[in] | srcWidth | Width of the source image. |
[in] | srcHeight | Height of the source image. |
[in] | srcRect | A pointer to coordinates of the rectangle in the source image. Set to NULL to specify a rectangle of full source image size. |
[in] | dstWidth | Width of the destination image. |
[in] | dstHeight | Height of the destination image. |
[in] | dstRect | A pointer to coordinates of the rectangle in the destination image. Set to NULL to specify a rectangle of full destination image size. |
[in] | initParams | A pointer to initialization parameters for creating an instance of LDC. See NvMediaLDCInitParams. |
NVMEDIA_STATUS_OK | indicates that the operation was successful. pldc points to a valid LDC handle. |
NVMEDIA_STATUS_NOT_INITIALIZED | indicates that the device handle was in an invalid state. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that one or more parameters were invalid. |
NVMEDIA_STATUS_NOT_SUPPORTED | indicates that the operation is not supported in the current configuration. TD Will the reader understand this? It seems very vague. What kind of configuration does it refer to? |
NVMEDIA_STATUS_OUT_OF_MEMORY | indicates that there was insufficient memory to perform the operation. |
NvMediaStatus NvMediaLDCDestroy | ( | NvMediaLDC * | ldc | ) |
Destroys an NvMedia LDC handle that was created by a call to NvMediaLDCCreateNew().
This function frees internal resources and handles allocated by NvMediaLDCCreateNew().
[in] | ldc | A handle to the current context, returned by NvMediaLDCCreateNew(). |
NVMEDIA_STATUS_OK | indicates that the operation was successful. The handle ldc was destroyed. |
NVMEDIA_STATUS_NOT_INITIALIZED | indicates that the device handle was in an invalid state. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that ldc is not a valid LDC handle. |
NVMEDIA_STATUS_ERROR | indicates that one or more objects were unregistered. |
NvMediaStatus NvMediaLDCFeedSparseWarpMap | ( | NvMediaLDC * | ldc, |
const NvMediaLDCSparseWarpMap * | map | ||
) |
Feeds a sparse warp map to NvMedia LDC.
NvMediaGeoTransMode must be NVMEDIA_GEOTRANS_MODE_FEED_MAPPING when this function is called. The sparse warp map must match the NvMediaLDCRegionConfig.
[in] | ldc | A handle to the current context, returned by NvMediaLDCCreateNew(). |
[in] | map | A pointer to a client-specified sparse warp map. |
NVMEDIA_STATUS_OK | indicates that the operation was successful. |
NVMEDIA_STATUS_NOT_INITIALIZED | indicates that the current context was in an invalid state. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that one or more parameters were invalid. |
NVMEDIA_STATUS_NOT_SUPPORTED | indicates that the operation is not supported in the current configuration. |
NVMEDIA_STATUS_OUT_OF_MEMORY | indicates that there was insufficient memory to perform the operation. |
NvMediaStatus NvMediaLDCGetVersion | ( | NvMediaVersion * | version | ) |
Returns the version information of NvMedia LDC.
[in] | version | A pointer to a structure to be filled by the NvMedia LDC. |
NvMediaStatus NvMediaLDCMappingGen | ( | NvMediaLDC * | ldc | ) |
Generates a sparse warp mapping based on NvMediaCameraModel.
NvMediaGeoTransMode must be NVMEDIA_GEOTRANS_MODE_GEN_MAPPING when this function is called.
This is a CPU-based operation.
[in] | ldc | A handle to the current context, returned by NvMediaLDCCreateNew(). |
NVMEDIA_STATUS_OK | indicates that the operation was successful. |
NVMEDIA_STATUS_NOT_INITIALIZED | indicates that the current context was in an invalid state. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that ldc was invalid. |
NVMEDIA_STATUS_NOT_SUPPORTED | indicates that the operation is not supported in the current configuration. |
NvMediaStatus NvMediaLDCProcess | ( | const NvMediaLDC * | ldc, |
NvMediaImage * | prevSurface, | ||
NvMediaImage * | curSurface, | ||
NvMediaImage * | outputSurface, | ||
NvMediaImage * | xSobel, | ||
NvMediaImage * | downSample, | ||
const NvMediaLDCCtrlParams * | ldcCtrlParams | ||
) |
Performs a specified LDC operation.
LDC performs transformations depending on the GEO mode:
LDC performs a geometric transformation if NvMediaLDCInitParams::ldcMode is NVMEDIA_LDC_MODE_GEOTRANS or NVMEDIA_LDC_MODE_GEOTRANS_TNR3. It uses NvMediaLDCInitParams::geoTransParams to fetch the pixel defined by srcRect in the source image and renders onto the destination rectangle of the destination image.
The source image and the destination image must have the same format.
LDC bypasses the transform stage if geometric transform is disabled.
The region of interest in the destination image is defined by:
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.
Use NvMediaImageGetStatus() to check the status of input/output images.
[in] | ldc | An LDC handle, obtained by a call to NvMediaLDCCreateNew(). |
[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. The application must create this surface. |
[in,out] | xSobel | A pointer to the xSobel image output. The application must create this surface. |
[in,out] | downSample | A pointer to the downsampled image output. The application must create this surface. |
[in] | ldcCtrlParams | A pointer to run-time control parameters. |
NVMEDIA_STATUS_OK | indicates that the operation was successful. |
NVMEDIA_STATUS_NOT_INITIALIZED | indicates that the current context was in an invalid state. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that one or more parameters were invalid. |
NVMEDIA_STATUS_NOT_SUPPORTED | indicates that the operation is not supported in the current configuration. |
NVMEDIA_STATUS_OUT_OF_MEMORY | indicates that there was insufficient memory to perform the operation. |
NVMEDIA_STATUS_ERROR | indicates that some other error occurred. |
NvMediaStatus NvMediaLDCUpdateTNR3Params | ( | const NvMediaLDC * | ldc, |
const NvMediaTNR3Params * | tnr3Params | ||
) |
Updates TNR3 parameters after a call to NvMediaLDCCreateNew().
NvMediaLDCCreateNew() initializes NvMediaLDC with TNR3 parameters specified as part of NvMediaLDCInitParams.
This function can be used to update the TNR3 parameters if necessary.
[in] | ldc | A handle to the current context, returned by NvMediaLDCCreateNew(). |
[in] | tnr3Params | A pointer to an object which holds TNR3 parameters. |
NVMEDIA_STATUS_OK | indicates that the operation was successful. |
NVMEDIA_STATUS_NOT_INITIALIZED | indicates that the current context was in an invalid state. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that one or more parameters were invalid. |
NVMEDIA_STATUS_NOT_SUPPORTED | indicates that the operation is not supported in the current configuration. |