Algorithm used to estimate the motion vectors from previous image to current image. More...
Functions | |
VPIStatus | vpiCreateOpticalFlowDense (uint32_t backends, int32_t width, int32_t height, VPIImageFormat inputFmt, VPIOpticalFlowQuality quality, VPIPayload *payload) |
Creates payload for vpiSubmitOpticalFlowDense. More... | |
VPIStatus | vpiSubmitOpticalFlowDense (VPIStream stream, uint32_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.
VPIStatus vpiCreateOpticalFlowDense | ( | uint32_t | backends, |
int32_t | width, | ||
int32_t | height, | ||
VPIImageFormat | inputFmt, | ||
VPIOpticalFlowQuality | quality, | ||
VPIPayload * | payload | ||
) |
#include <vpi/algo/OpticalFlowDense.h>
Creates payload for vpiSubmitOpticalFlowDense.
[in] | backends | VPI backends that are eligible to execute the algorithm. Currently only VPI_BACKEND_NVENC is accepted. |
[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 memory where the created payload handle will be written to. |
VPIStatus vpiSubmitOpticalFlowDense | ( | VPIStream | stream, |
uint32_t | backend, | ||
VPIPayload | payload, | ||
VPIImage | prevImg, | ||
VPIImage | curImg, | ||
VPIImage | mvImg | ||
) |
#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. Must be one of the backends specified during payload creation. If 0, VPI will select one of the eligible backends from the payload that accepts the given parameters, usually the fastest one. |
[in] | payload | Payload created with vpiCreateOpticalFlowDense |
[in] | prevImg | Previous frame |
[in] | curImg | Current frame |
[out] | mvImg | Motion vectors output. Only VPI_IMAGE_FORMAT_2S16_BL is supported. Motion vector is in fixed point S10.5 format. Note VPI_BACKEND_NVENC expects dimension of the motion vectors output to be 1/4 of the current and previous image. |