Estimates disparity from a stereo pair. More...
Data Structures | |
struct | VPIStereoDisparityEstimatorCreationParams |
Structure that defines the parameters for vpiCreateStereoDisparityEstimator. More... | |
struct | VPIStereoDisparityEstimatorParams |
Structure that defines the parameters for vpiSubmitStereoDisparityEstimator. More... | |
Enumerations | |
enum | VPIStereoDisparityConfidenceType |
Defines the way the confidence values are computed. More... | |
Functions | |
VPIStatus | vpiInitStereoDisparityEstimatorCreationParams (VPIStereoDisparityEstimatorCreationParams *params) |
Initializes VPIStereoDisparityEstimatorCreationParams with default values. More... | |
VPIStatus | vpiCreateStereoDisparityEstimator (uint64_t backends, int32_t imageWidth, int32_t imageHeight, VPIImageFormat inputFormat, const VPIStereoDisparityEstimatorCreationParams *params, VPIPayload *payload) |
Creates payload for vpiSubmitStereoDisparityEstimator. More... | |
VPIStatus | vpiInitStereoDisparityEstimatorParams (VPIStereoDisparityEstimatorParams *params) |
Initializes VPIStereoDisparityEstimatorParams with default values. More... | |
VPIStatus | vpiSubmitStereoDisparityEstimator (VPIStream stream, uint64_t backend, VPIPayload payload, VPIImage left, VPIImage right, VPIImage disparity, VPIImage confidenceMap, const VPIStereoDisparityEstimatorParams *params) |
Runs stereo processing on a pair of images and outputs a disparity map. More... | |
Estimates disparity from a stereo pair.
Refer to Stereo Disparity Estimator for more details and usage examples.
struct VPIStereoDisparityEstimatorCreationParams |
Structure that defines the parameters for vpiCreateStereoDisparityEstimator.
Definition at line 82 of file StereoDisparity.h.
struct VPIStereoDisparityEstimatorParams |
Structure that defines the parameters for vpiSubmitStereoDisparityEstimator.
Definition at line 220 of file StereoDisparity.h.
Data Fields | ||
---|---|---|
int32_t | windowSize |
Represents the median filter size (on PVA+NVENC+VIC or OFA+PVA+VIC backend) or census transform window size (other backends) used in the algorithm.
|
int32_t | maxDisparity |
Maximum disparity for matching search.
|
int32_t | confidenceThreshold |
Confidence threshold above which disparity values are considered valid. Only used in CUDA, PVA+NVENC+VIC, and OFA+PVA+VIC backends.
|
int32_t | quality |
Quality of disparity output. It's only applicable when using PVA+NVENC+VIC backend. The higher the value, better the quality and possibly slower perf.
|
VPIStereoDisparityConfidenceType | confidenceType |
Computation type to produce the confidence output.
|
int32_t | minDisparity |
Minimum possible disparity value. It's only applicable when using CUDA backend. Normally it is zero, but it may be adjusted depending on input images.
|
int32_t | p1 |
Penalty on disparity changes of +/- 1 between neighbor pixels. It is normally a small value, in (min, max) disparity range, used to penalize small changes in disparity, i.e. one. Using a lower P1 penalty allows for an adaptation to slanted or curver surfaces. (Please refer to paper_sgm on how penalties affect disparity values.) It's only applicable when using CUDA and OFA backends.
|
int32_t | p2 |
Penalty on disparity changes of more than 1 between neighbor pixels. It is normally a large value, in (min, max) disparity range, used to penalize large changes in disparity. Using a higher P2 penalty avoids abrupt disparity changes, i.e. discontinuities. (Please refer to paper_sgm on how penalties affect disparity values.) It's only applicable when using CUDA and OFA backends.
|
int32_t | p2Alpha |
Alpha is used to enable adaptive large penalty (adaptive P2) feature. It's used to better preserve object boundaries and thin objects. Higher alpha indicates lower adaptation of P2 in accordance to pixel intensities. It's the alpha value in: P2' = - (1 / alpha) * abs(I_cur - I_prev) + P2; where P2' is the adaptive version of the given P2 penalty. The abs(I_cur - I_prev) is the absolute difference in intensity between the current and previous pixel location along the direction of path cost evaluation. The intuition behind this adaptation is that large disparity differences should be penalized less if they coincide with large intensity changes. The alpha value can be 0, 1, 2, 4 or 8. Using an alpha value of 0 disables the adaptive P2 feature. It's only applicable when using OFA backend.
|
float | uniqueness |
Uniqueness ratio, in [0, 1] range, is a margin by which best cost value should win over the second best. A value of 1 means less pixels are marked invalid, as the full cost is considered when comparing against the current best cost. Values less than 1 mean only a ratio of the cost is considered for the best cost. A value of 0 means more pixels are marked invalid, as only disparity changes of +/- 1 pixels are considered. Use it to improve certainty of computed disparity. Use value outside [0, 1], such as -1, to disregard the uniqueness computation. It's only applicable when using CUDA backend. |
int8_t | numPasses |
Number of passes in memory-efficient semi-global matching (eSGM) computation. A value of 1 or 2 means to do one forward or one forward and one backward passes per direction. A value of 3 means to do another forward pass after forward and backward passes. Setting number of passes to 3 makes the stereo disparity estimator slower, but increases the result quality. It's only applicable when using OFA backends.
|
#include </opt/nvidia/vpi2/include/vpi/algo/StereoDisparity.h>
Defines the way the confidence values are computed.
This computation needs the disparity difference from left to right (D_lr) and from right to left (D_rl), and potentially the maximum disparity (MAX_DISP). Lower confidence values (than the given confidence threshold parameter) make the output disparity invalid.
Definition at line 203 of file StereoDisparity.h.
VPIStatus vpiInitStereoDisparityEstimatorCreationParams | ( | VPIStereoDisparityEstimatorCreationParams * | params | ) |
#include </opt/nvidia/vpi2/include/vpi/algo/StereoDisparity.h>
Initializes VPIStereoDisparityEstimatorCreationParams with default values.
Defaults:
[in] | params | Structure to be filled with default values. |
VPI_ERROR_INVALID_ARGUMENT | params is NULL. |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiCreateStereoDisparityEstimator | ( | uint64_t | backends, |
int32_t | imageWidth, | ||
int32_t | imageHeight, | ||
VPIImageFormat | inputFormat, | ||
const VPIStereoDisparityEstimatorCreationParams * | params, | ||
VPIPayload * | payload | ||
) |
#include </opt/nvidia/vpi2/include/vpi/algo/StereoDisparity.h>
Creates payload for vpiSubmitStereoDisparityEstimator.
[in] | backends | VPI backends that are eligible to execute the algorithm.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | imageWidth,imageHeight | Input image dimensions.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | inputFormat | Input image format.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | params | Creation parameters. Pass NULL to use defaults given by vpiInitStereoDisparityEstimatorCreationParams. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[out] | payload | Pointer to the payload variable that receives the created handle. |
VPI_ERROR_INVALID_IMAGE_FORMAT | inputFormat is not supported. |
VPI_ERROR_INVALID_ARGUMENT | payload is NULL. |
VPI_ERROR_INVALID_ARGUMENT | imageWidth or imageHeight outside valid range. |
VPI_ERROR_INVALID_ARGUMENT | backends refers to an invalid backend. |
VPI_ERROR_INVALID_ARGUMENT | Maximum disparity in params outside valid range. |
VPI_ERROR_NOT_IMPLEMENTED | Stereo Disparity Estimator algorithm is not supported by given backends. |
VPI_ERROR_INVALID_OPERATION | Backend hardware not available. |
VPI_ERROR_INVALID_CONTEXT | Current context is destroyed. |
VPI_ERROR_OUT_OF_MEMORY | Cannot allocate required resources. |
VPI_ERROR_INVALID_OPERATION | Backend isn't enabled in current context. |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiInitStereoDisparityEstimatorParams | ( | VPIStereoDisparityEstimatorParams * | params | ) |
#include </opt/nvidia/vpi2/include/vpi/algo/StereoDisparity.h>
Initializes VPIStereoDisparityEstimatorParams with default values.
Defaults:
[in] | params | Structure to be filled with default values. |
VPI_ERROR_INVALID_ARGUMENT | params is NULL. |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiSubmitStereoDisparityEstimator | ( | VPIStream | stream, |
uint64_t | backend, | ||
VPIPayload | payload, | ||
VPIImage | left, | ||
VPIImage | right, | ||
VPIImage | disparity, | ||
VPIImage | confidenceMap, | ||
const VPIStereoDisparityEstimatorParams * | params | ||
) |
#include </opt/nvidia/vpi2/include/vpi/algo/StereoDisparity.h>
Runs stereo processing on a pair of images and outputs a disparity map.
[in] | stream | The stream where the operation will be queued in.
|
[in] | backend | Backend that will execute the algorithm.
|
[in] | payload | Payload to be submitted along the other parameters. |
[in] | left | Left stereo input image.
|
[in] | right | Right stereo input image.
|
[out] | disparity | Image where the disparity values will be written to. Returned values are in Q10.5 format, i.e., signed fixed point with 5 fractional bits. Divide it by 32.0f to convert it to floating point.
|
[out] | confidenceMap | Image containing a confidence score telling how accurate the disparity is. Pass NULL if it isn't needed. Returned confidence range from 0 to 65535. The higher the confidence, more accurate is the corresponding disparity.
|
[in] | params | Pointer to algorithm control parameters. If NULL, it'll use the defaults given by vpiInitStereoDisparityEstimatorParams. |
VPI_ERROR_INVALID_ARGUMENT | stream is NULL. |
VPI_ERROR_INVALID_ARGUMENT | left , right or disparity are NULL. |
VPI_ERROR_INVALID_ARGUMENT | Maximum disparity in params outside valid range. |
VPI_ERROR_INVALID_ARGUMENT | Window size in params outside valid range. |
VPI_ERROR_INVALID_ARGUMENT | left and right images must have the same dimensions. |
VPI_ERROR_INVALID_ARGUMENT | Input image dimensions must be equal to what's configured in payload . |
VPI_ERROR_INVALID_ARGUMENT | confidenceMap and disparity must have same dimensions. |
VPI_ERROR_INVALID_ARGUMENT | Backend doesn't output confidence map. |
VPI_ERROR_INVALID_IMAGE_FORMAT | left and right format don't match payload image format. |
VPI_ERROR_INVALID_IMAGE_FORMAT | disparity format is invalid. |
VPI_ERROR_INVALID_PAYLOAD_TYPE | payload is invalid. |
VPI_ERROR_INVALID_OPERATION | The needed backends aren't enabled in stream , left , right , disparity or confidenceMap . |
VPI_SUCCESS | Operation executed successfully. |