Documentation

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.

opticalFlow class

Object for storing optical flow matrices

Description

Note

The vision.opticalFlow System object will be removed in a future release. Use opticalFlowHS, opticalFlowLKDoG, opticalFlowLK, or opticalFlowFarneback with equivalent functionality instead.

The OpticalFlow object stores the direction and speed of a moving object from one image or video frame to another.

Construction

flow = opticalFlow(Vx,Vy) constructs an optical flow object from two equal-sized matrices, Vx and Vy, which are the x and y components of velocity.

flow = opticalFlow(___,Name,Value) includes additional options specified by one or more Name,Value pair arguments.

Code Generation Support
Supports Code Generation: Yes
Supports MATLAB® Function block: Yes
Code Generation Support, Usage Notes, and Limitations.

Input Arguments

expand all

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'Vx',randn(100,100)

expand all

X component of velocity, specified as the comma-separated pair consisting of 'Vx' and an M-by-N matrix.

Y component of velocity, specified as the comma-separated pair consisting of 'Vy' and an M-by-N matrix.

Phase angles of optical flow in radians, specified as the comma-separated pair consisting of 'Orientation' and an M-by-N matrix of size Vx or Vy.

Magnitude of optical flow, specified as the comma-separated pair consisting of 'Magnitude' and an M-by-N matrix.

Methods

plotPlot optical flow

Examples

expand all

Construct an optical flow object.

opflow = opticalFlow(randn(100,100),randn(100,100));

Plot the velocity of the object as a quiver plot.

plot(opflow,'DecimationFactor',[10 10],'ScaleFactor',10);

Introduced in R2015a