vpi.OpticalFlowPyrLK
- class vpi.OpticalFlowPyrLK(frame: vpi.Pyramid, keypoints: vpi.Array, *, kptstatus: vpi.Array = None, backend: vpi.Backend = vpi.Backend.DEFAULT) vpi.OpticalFlowPyrLK
- class vpi.OpticalFlowPyrLK(frame: vpi.Image, keypoints: vpi.Array, levels: int, *, kptstatus: vpi.Array = None, scale: float = 0.5, backend: vpi.Backend = vpi.Backend.DEFAULT) vpi.OpticalFlowPyrLK
Creates the basis for the PyrLKOFlow algorithm.
Note
This class allocates all resources needed by the Pyramidal Lucas-Kanade Optical Flow (PyrLKOFlow) algorithm. An object of this class is able to run the PyrLKOFlow algorithm via its
call operator
.- Parameters
frame (vpi.Pyramid or vpi.Image) – Defines the previous frame by either directly the Gaussian pyramid or the base image of it.
levels (int, optional) – Defines the number of levels in the Gaussian pyramid of the previous frame when it is an image.
scale (float, optional) – Defines the scale of the Gaussian pyramid of the previous frame when it is an image.
keypoints (vpi.Array) – Array of keypoints in the Gaussian pyramid of the previous frame (in the base highest resolution image).
kptstatus (vpi.Array, optional) – Status array for tracking status for each input in keypoints. If element is 0, the corresponding keypoint is being tracked, otherwide, tracking is lost.
backend (vpi.Backend, optional) – The backend to be used by the algorithm.
- Returns
The main object of the PyrLKOFlow algorihtm.
- Return type
Caution
Restrictions to several arguments may apply. Check the C API references of the create payload function and the group concepts for more details.
Methods
__call__
(self, frame[, keypoints, winsize, ...])Runs a PyrLKOFlow algorithm on two frames.