Algorithm used to estimate the motion vectors from previous image to current image.
More...
|
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...
|
|
Algorithm used to estimate the motion vectors from previous image to current image.
Refer to Dense Optical Flow for more details and usage examples.
◆ vpiCreateOpticalFlowDense()
#include </opt/nvidia/vpi2/include/vpi/algo/OpticalFlowDense.h>
Creates payload for vpiSubmitOpticalFlowDense.
- Parameters
-
[in] | backends | VPI backends that are eligible to execute the algorithm.
- Supported backends:
- Backend must be enabled in current context.
|
[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.
- The accepted image formats are:
|
[in] | quality | Quality of the dense optical flow algorithm. |
[out] | payload | Pointer to the payload variable that receives the created handle. |
- Return values
-
◆ vpiSubmitOpticalFlowDense()
#include </opt/nvidia/vpi2/include/vpi/algo/OpticalFlowDense.h>
Runs dense Optical Flow on two frames, outputting motion vectors.
- Parameters
-
[in] | stream | The stream where the operation will be queued in.
- Must not be NULL.
- Stream must have enabled the backends that will execute the algorithm.
|
[in] | backend | Backend that will execute the algorithm.
- Must be the backend specified during payload creation or 0 as a shorthand to use this backend.
|
[in] | payload | Payload created by vpiCreateOpticalFlowDense.
- The number of pyramid levels specified in the payload must be 1.
|
[in] | prevImg | Previous frame.
- Must not be NULL.
- Must have same format and dimensions as the one specified during payload creation.
- Image must have enabled the backends that will execute the algorithm.
|
[in] | curImg | Current frame.
- Must not be NULL.
- Must have same format and dimensions as
prevImg .
- Image must have enabled the backends that will execute the algorithm.
|
[out] | mvImg | Motion vectors output.
- Must not be NULL.
- Image must have enabled the backends that will execute the algorithm.
- The width and height depend on the input dimensions and grid size specified on the payload. It's calculated by:
- output_width = (input_width + gridSize-1)/gridSize
- output_height = (input_height + gridSize-1)/gridSize
- Supported formats:
|
- Return values
-
◆ vpiSubmitOpticalFlowDensePyramid()
#include </opt/nvidia/vpi2/include/vpi/algo/OpticalFlowDense.h>
Runs dense Optical Flow on two frames, outputting motion vectors.
- Parameters
-
[in] | stream | The stream where the operation will be queued in.
- Must not be NULL.
- Stream must have enabled the backends that will execute the algorithm.
|
[in] | backend | Backend that will execute the algorithm.
- Must be the backend specified during payload creation or 0 as a shorthand to use this backend.
|
[in] | payload | Payload created by vpiCreateOpticalFlowDense. |
[in] | prevPyr | Previous pyramid frame.
- Must not be NULL.
- Must have same format and dimensions as the one specified during payload creation.
- Pyramid height must be >= the number of pyramid levels specified in the payload.
- Pyramid must have enabled the backends that will execute the algorithm.
|
[in] | curPyr | Current pyramid frame.
- Must not be NULL.
- Must have same format and dimensions as
prevImg .
- Number of pyramid levels must be the same as specified in the payload.
- Pyramid must have enabled the backends that will execute the algorithm.
|
[out] | mvImg | Motion vectors output.
- Must not be NULL.
- Image must have enabled the backends that will execute the algorithm.
- The width and height depend on the input dimensions and grid size of the bottom pyramid level specified in the payload. It's calculated by:
- output_width = (input_width + gridSize-1)/gridSize
- output_height = (input_height + gridSize-1)/gridSize
- Supported formats:
|
- Return values
-