vpi.optflow_dense

vpi.optflow_dense(ref: vpi.Image, frame: vpi.Image, *, out: vpi.Image = None, gridSize: int = 4, quality: vpi.OptFlowQuality = vpi.OptFlowQuality.HIGH, backend: vpi.Backend = vpi.Backend.DEFAULT, stream: vpi.Stream = None) vpi.Image
vpi.optflow_dense(ref: vpi.Pyramid, frame: vpi.Pyramid, *, out: vpi.Image = None, gridSize: int = 4, quality: vpi.OptFlowQuality = vpi.OptFlowQuality.HIGH, backend: vpi.Backend = vpi.Backend.DEFAULT, stream: vpi.Stream = None) vpi.Image

Runs dense optical flow on two images.

Algorithm used to estimate the motion vectors from previous image to current image. Outputs motion vectors for every 4x4 pixel block in the input image.

See also

Refer to the algorithm explanation for more details and usage examples.

Parameters
  • ref (vpi.Image) – Previous reference image frame.

  • frame (vpi.Image) – Current image frame. Must have same format and dimension as ref previous frame.

  • out (vpi.Image, optional) – Motion vectors output image of the algorithm.

  • gridSize (int, optional) – Size of the output grid, default = 4 (meaning 4x4).

  • quality (vpi.OptFlowQuality, optional) – Quality of the dense optical flow algorithm.

  • backend (vpi.Backend, optional) – The backend to be used by the algorithm.

  • stream (vpi.Stream, optional) – The stream to be used by the algorithm.

Returns

The output for the algorithm.

Return type

vpi.Image

Caution

Restrictions to several arguments may apply. Check the C API references of the submit function and the group concepts for more details.

Runs dense Optical Flow on two frames using pyramids.

Algorithm used to estimate the motion vectors from previous to current pyramid. Outputs motion vectors for every 4x4 pixel block in the input pyramid.

See also

Refer to the algorithm explanation for more details and usage examples.

Parameters
  • ref (vpi.Pyramid) – Previous reference frame.

  • frame (vpi.Pyramid) – Current frame. Must have same format, dimension and number of levels as ref previous frame.

  • out (vpi.Image, optional) – Motion vectors output image of the algorithm.

  • gridSize (int, optional) – Size of the output grid, default = 4 (meaning 4x4).

  • quality (vpi.OptFlowQuality, optional) – Quality of the dense optical flow algorithm.

  • backend (vpi.Backend, optional) – The backend to be used by the algorithm.

  • stream (vpi.Stream, optional) – The stream to be used by the algorithm.

Returns

The output for the algorithm.

Return type

vpi.Image

Caution

Restrictions to several arguments may apply. Check the C API references of the submit function and the group concepts for more details.