VPI - Vision Programming Interface

1.2 Release

Dense Optical Flow

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...
 

Detailed Description

Algorithm used to estimate the motion vectors from previous image to current image.

Function Documentation

◆ vpiCreateOpticalFlowDense()

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.

Parameters
[in]backendsVPI backends that are eligible to execute the algorithm. Currently only VPI_BACKEND_NVENC is accepted.
[in]width,heightDimensions of current and previous image
[in]inputFmtFormat of current and previous image.
[in]qualityQuality of the dense optical flow algorithm.
[out]payloadPointer to memory where the created payload handle will be written to.
Returns
an error code on failure else VPI_SUCCESS.

◆ vpiSubmitOpticalFlowDense()

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.

Parameters
[in]streamThe stream where the operation will be queued in.
[in]backendBackend 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]payloadPayload created with vpiCreateOpticalFlowDense
[in]prevImgPrevious frame
[in]curImgCurrent frame
[out]mvImgMotion 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.
Returns
an error code on failure else VPI_SUCCESS