This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


System object: vision.OpticalFlow
Package: vision

Estimate direction and speed of object motion between video frames


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


    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

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 (MATLAB) 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?