Contents

step

System object: vision.OpticalFlow
Package: vision

Estimate direction and speed of object motion between video frames

Syntax

VSQ = step(opticalFlow,I)
V = step(opticalFlow,I)
[...] = step(opticalFlow,I1,I2)
[..., IMV] = step(opticalFlow,I)

Description

VSQ = step(opticalFlow,I) computes the optical flow of input image, I, from one video frame to another, and returns VSQ, specified as a matrix of velocity magnitudes.

V = step(opticalFlow,I) computes the optical flow of input image. I, from one video frame to another, and returns V, specified as a complex matrix of horizontal and vertical components. This applies when you set the OutputValue property to 'Horizontal and vertical components in complex form'.

[...] = step(opticalFlow,I1,I2) computes the optical flow of the input image I1, using I2 as a reference frame. This applies when you set the ReferenceFrameSource property to 'Input port'.

[..., IMV] = step(opticalFlow,I) outputs the delayed input image, IMV. The delay is equal to the latency introduced by the computation of the motion vectors. This property applies when you set the Method property to 'Lucas-Kanade', the TemporalGradientFilter property to 'Derivative of Gaussian', and the MotionVectorImageOutputport property to true.

    Note:   H specifies the System object™ on which to run this step method.

    The object performs an initialization the first time the step method is executed. This initialization locks nontunable properties and input specifications, such as dimensions, complexity, and data type of the input data. If you change a nontunable property or an input specification, the System object issues an error. To change nontunable properties or inputs, you must first call the release method to unlock the object.

Was this topic helpful?