Algorithm used to estimate the motion vectors from previous image to current image. More...
Functions | |
| VPIStatus | vpiCreateOpticalFlowDense (uint64_t backends, int32_t width, int32_t height, VPIImageFormat inputFmt, 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. 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.
| VPIStatus vpiCreateOpticalFlowDense | ( | uint64_t | backends, |
| int32_t | width, | ||
| int32_t | height, | ||
| VPIImageFormat | inputFmt, | ||
| 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.
|
| [in] | inputFmt | Format of current and previous image.
|
| [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 or height 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.
Outputs motion vectors for every 4x4 pixel block in the input image.
| [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 | 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. |