Algorithm used to estimate the motion vectors from previous image to current image. More...
Data Structures | |
struct | VPIOpticalFlowDenseSGMParams |
Dense optical flow parameters for semi-global matching pass. More... | |
Functions | |
VPIStatus | vpiCreateOpticalFlowDense (uint64_t backends, int32_t width, int32_t height, VPIImageFormat inputFmt, const int32_t *gridSize, int32_t numLevels, VPIOpticalFlowQuality quality, VPIPayload *payload) |
Creates payload for vpiSubmitOpticalFlowDense. More... | |
VPIStatus | vpiSubmitOpticalFlowDense (VPIStream stream, uint64_t backend, VPIPayload payload, VPIImage prevImg, VPIImage curImg, VPIImage mvImg) |
Runs dense Optical Flow on two frames, outputting motion vectors. More... | |
VPIStatus | vpiSubmitOpticalFlowDensePyramid (VPIStream stream, uint64_t backend, VPIPayload payload, VPIPyramid prevPyr, VPIPyramid curPyr, VPIImage mvImg) |
Runs dense Optical Flow on two frames, outputting motion vectors. More... | |
VPIStatus | vpiOpticalFlowDenseGetSGMParams (VPIPayload payload, VPIOpticalFlowDenseSGMParams *sgmParams) |
Retrieves the semi-global matching parameters set up in the Dense Optical Flow payload. More... | |
VPIStatus | vpiOpticalFlowDenseSetSGMParams (VPIPayload payload, const VPIOpticalFlowDenseSGMParams *sgmParams) |
Sets the semi-global matching parameters to be used by the Dense Optical Flow operations with the given payload. More... | |
Algorithm used to estimate the motion vectors from previous image to current image.
Refer to Dense Optical Flow for more details and usage examples.
struct VPIOpticalFlowDenseSGMParams |
Dense optical flow parameters for semi-global matching pass.
Each pyramid level can be associated with different parameters. The first value in the arrays corresponds to the bottom (finer) level, the last corresponds to the top (coarse) level.
Definition at line 259 of file OpticalFlowDense.h.
Data Fields | ||
---|---|---|
int32_t | p1[VPI_MAX_PYRAMID_LEVEL_COUNT] |
P1 penalty value of semi-global matching algorithm used. Only used by OFA backend and ignored by others. |
int32_t | p2[VPI_MAX_PYRAMID_LEVEL_COUNT] |
P2 penalty value of semi-global matching algorithm used. Only used by OFA backend and ignored by others. |
int32_t | p2Alpha[VPI_MAX_PYRAMID_LEVEL_COUNT] |
Alpha value for adaptative P2 used in semi-global matching.
|
int32_t | numPasses[VPI_MAX_PYRAMID_LEVEL_COUNT] |
Number of semi-global matching passes.
|
int8_t | includeDiagonals[VPI_MAX_PYRAMID_LEVEL_COUNT] |
Enable/disable diagonal directions in semi-global matching.
|
VPIStatus vpiCreateOpticalFlowDense | ( | uint64_t | backends, |
int32_t | width, | ||
int32_t | height, | ||
VPIImageFormat | inputFmt, | ||
const int32_t * | gridSize, | ||
int32_t | numLevels, | ||
VPIOpticalFlowQuality | quality, | ||
VPIPayload * | payload | ||
) |
#include </opt/nvidia/vpi2/include/vpi/algo/OpticalFlowDense.h>
Creates payload for vpiSubmitOpticalFlowDense.
[in] | backends | VPI backends that are eligible to execute the algorithm.
| |||||||||
[in] | width,height | Dimensions of current and previous image. The output dimensions depend on the gridSize and the input dimensions.
| |||||||||
[in] | gridSize | Array with grid sizes for each pyramid level. If working with input images, not pyramids, gridSize points to the single grid size used, as if it were for a pyramid with only one level. The first value in the array corresponds to the bottom (finer) level, the last corresponds to the top (coarse) level. Passing 1 allows for a dense grid. With 2 or more, the grid will be sparse. The output image dimensions depend on the first value in gridSize and the input dimensions.
| |||||||||
[in] | numLevels | Number of pyramid levels to be processed. When using pyramids as inputs, this specifies the number of levels to be considered. When using images, numLevels must be 1.
| |||||||||
[in] | inputFmt | Format of current and previous image/pyramid.
| |||||||||
[in] | quality | Quality of the dense optical flow algorithm. | |||||||||
[out] | payload | Pointer to the payload variable that receives the created handle. |
VPI_IMAGE_FORMAT_INVALID | inputFmt is not supported. |
VPI_ERROR_INVALID_ARGUMENT | payload is NULL. |
VPI_ERROR_INVALID_ARGUMENT | width , height , numLevels or gridSize outside valid range. |
VPI_ERROR_INVALID_ARGUMENT | backends refers to an invalid backend. |
VPI_ERROR_INVALID_OPERATION | Backend hardware not available. |
VPI_ERROR_INVALID_OPERATION | Backend isn't enabled in current context. |
VPI_ERROR_NOT_IMPLEMENTED | Dense Optical Flow algorithm is not supported by given backends. |
VPI_ERROR_INVALID_CONTEXT | Current context is destroyed. |
VPI_ERROR_OUT_OF_MEMORY | Cannot allocate required resources. |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiSubmitOpticalFlowDense | ( | VPIStream | stream, |
uint64_t | backend, | ||
VPIPayload | payload, | ||
VPIImage | prevImg, | ||
VPIImage | curImg, | ||
VPIImage | mvImg | ||
) |
#include </opt/nvidia/vpi2/include/vpi/algo/OpticalFlowDense.h>
Runs dense Optical Flow on two frames, outputting motion vectors.
[in] | stream | The stream where the operation will be queued in.
|
[in] | backend | Backend that will execute the algorithm.
|
[in] | payload | Payload created by vpiCreateOpticalFlowDense.
|
[in] | prevImg | Previous frame.
|
[in] | curImg | Current frame.
|
[out] | mvImg | Motion vectors output.
|
VPI_ERROR_INVALID_ARGUMENT | stream is NULL. |
VPI_ERROR_INVALID_ARGUMENT | prevImg , curImg or mvImg are NULL. |
VPI_ERROR_INVALID_ARGUMENT | payload is not generated using vpiCreateOpticalFlowDense. |
VPI_ERROR_INVALID_ARGUMENT | number of pyramid levels specified in payload is not 1. |
VPI_ERROR_INVALID_ARGUMENT | prevImg and curImg dimensions does not match the one associated with the payload . |
VPI_ERROR_INVALID_IMAGE_FORMAT | prevImg and curImg format does not match the one associated with the payload . |
VPI_ERROR_INVALID_PAYLOAD_TYPE | payload is invalid. |
VPI_ERROR_INVALID_OPERATION | The needed backends aren't enabled in stream , prevImg , curImg or mvImg . |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiSubmitOpticalFlowDensePyramid | ( | VPIStream | stream, |
uint64_t | backend, | ||
VPIPayload | payload, | ||
VPIPyramid | prevPyr, | ||
VPIPyramid | curPyr, | ||
VPIImage | mvImg | ||
) |
#include </opt/nvidia/vpi2/include/vpi/algo/OpticalFlowDense.h>
Runs dense Optical Flow on two frames, outputting motion vectors.
[in] | stream | The stream where the operation will be queued in.
|
[in] | backend | Backend that will execute the algorithm.
|
[in] | payload | Payload created by vpiCreateOpticalFlowDense. |
[in] | prevPyr | Previous pyramid frame.
|
[in] | curPyr | Current pyramid frame.
|
[out] | mvImg | Motion vectors output.
|
VPI_ERROR_INVALID_ARGUMENT | stream is NULL. |
VPI_ERROR_INVALID_ARGUMENT | prevPyr , cuurPyr or mvImg are NULL. |
VPI_ERROR_INVALID_ARGUMENT | payload is not generated using vpiCreateOpticalFlowDense. |
VPI_ERROR_INVALID_ARGUMENT | prevPyr and cuurPyr dimensions does not match the one associated with the payload . |
VPI_ERROR_INVALID_ARGUMENT | prevPyr and curPyr number of Levels out of valid range. |
VPI_ERROR_INVALID_IMAGE_FORMAT | prevPyr and curPyr format does not match the one associated with the payload . |
VPI_ERROR_INVALID_PAYLOAD_TYPE | payload is invalid. |
VPI_ERROR_INVALID_OPERATION | The needed backends aren't enabled in stream , prevPyr , cuurPyr or mvImg . |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiOpticalFlowDenseGetSGMParams | ( | VPIPayload | payload, |
VPIOpticalFlowDenseSGMParams * | sgmParams | ||
) |
#include </opt/nvidia/vpi2/include/vpi/algo/OpticalFlowDense.h>
Retrieves the semi-global matching parameters set up in the Dense Optical Flow payload.
[in] | payload | Payload created by vpiCreateOpticalFlowDense.
|
[out] | sgmParams | Structure where parameters will be written to.
|
VPI_ERROR_INVALID_PAYLOAD_TYPE | payload is invalid. |
VPI_ERROR_INVALID_ARGUMENT | sgmParams is NULL. |
VPI_ERROR_INVALID_OPERATION | payload was not created for OFA dense optical flow. |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiOpticalFlowDenseSetSGMParams | ( | VPIPayload | payload, |
const VPIOpticalFlowDenseSGMParams * | sgmParams | ||
) |
#include </opt/nvidia/vpi2/include/vpi/algo/OpticalFlowDense.h>
Sets the semi-global matching parameters to be used by the Dense Optical Flow operations with the given payload.
The parameters will be only effective on future dense optical flow operations on the given payload. Already submitted operations won't be affected.
[in] | payload | Payload created by vpiCreateOpticalFlowDense.
|
[in] | sgmParams | SGM parameters to be used by future dense optical flow submissions with given payload.
|
VPI_ERROR_INVALID_PAYLOAD_TYPE | payload is invalid. |
VPI_ERROR_INVALID_ARGUMENT | sgmParams is NULL. |
VPI_ERROR_INVALID_OPERATION | payload was not created for OFA dense optical flow. |
VPI_SUCCESS | Operation executed successfully. |