vpi.OpticalFlowPyrLK.__call__

OpticalFlowPyrLK.__call__(self: vpi.OpticalFlowPyrLK, frame: Union[vpi.Pyramid, vpi.Image], keypoints: vpi.Array = None, *, winsize: int = 15, termcriteria: int = 3, epsilon: float = 0.0, maxiter: int = 6, stream: vpi.Stream = None) Tuple[vpi.Array, vpi.Array]

Runs a PyrLKOFlow algorithm on two frames.

Hint

The Pyramidal Lucas-Kanade Optical Flow (PyrLKOFlow) algorithm uses one previous frame and one current frame. The previous frame is provided automatically behind the scene by the class.

See also

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

Parameters
  • frame (vpi.Pyramid or vpi.Image) – Defines the current frame by either directly the Gaussian pyramid or the base image of it. It uses the number of levels and scale of the previous frame in case of an image.

  • keypoints (vpi.Array) – Array of keypoints in the Gaussian pyramid of the current frame (in the base highest resolution image).

  • winsize (int, optional) – Specifies the size of the window on which to perform the algorithm. Expects between 6 and 32 (inclusive).

  • termcriteria (vpi.TerminationCriteria, optional) – Specifies the termination criteria.

  • epsilon (float, optional) – Specifies minimum error threshold for terminating the algorithm. Only applicable if termination criteria is vpi.TerminationCriteria.EPSILON.

  • maxiter (int, optional) – Specifies the maximum number of iterations. Only applicable if termination criteria is vpi.TerminationCriteria.ITERATIONS.

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

Returns

A tuple with the resulting keypoints and their tracking statuses, respectively.

Return type

Tuple[vpi.Array, vpi.Array]

Caution

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