plot
Plot optical flow vectors
Description
plot(
plots the optical flow
vectors.flow
)
plot(
specifies options using one or more name-value arguments in addition to any
combination of arguments from previous syntaxes. For example,
flow
,Name=Value
)plot(flow,Color="red")
plots the optical flow with red flow
vectors.
Examples
Create an Optical Flow Object and Plot Its Velocity
Create an optical flow object from two equal-sized velocity matrices.
Vx = randn(100,100); Vy = randn(100,100); opflow = opticalFlow(Vx,Vy);
Inspect the properties of the optical flow object. The orientation and the magnitude are computed from the velocity matrices.
opflow
opflow = opticalFlow with properties: Vx: [100x100 double] Vy: [100x100 double] Orientation: [100x100 double] Magnitude: [100x100 double]
Plot the velocity of the object as a quiver plot.
plot(opflow,DecimationFactor=[10 10],ScaleFactor=10);
Input Arguments
flow
— Object containing optical flow matrices
opticalFlow
object
Object containing optical flow velocity matrices, specified as an opticalFlow
object.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: plot(flow,Color="red")
plots the optical flow with red
flow vectors.
DecimationFactor
— Decimation factor of velocity vectors
[1 1]
(default) | two-element vector
Decimation factor of velocity vectors, specified as a two-element vector. The two-element vector is of form [XDecimFactor YDecimFactor] and specifies the decimation factor for velocity vectors along the x and y directions respectively. XDecimFactor and YDecimFactor are positive scalar integers. Increase the value of this property to get a less cluttered quiver plot.
ScaleFactor
— Scaling factor for velocity vector display
1
(default) | positive integer-valued scalar
Scaling factor for velocity vector display, specified as a positive integer-valued scalar. Increase this value to display longer vectors.
Parent
— Figure axes
gca
handle
Figure axes, specified as an axes object. The default is set to the
current axes handle, gca
.
Color
— Color of optical flow vectors
"blue" (default) | RGB triplet | long or short color name
Color of optical flow vectors, specified as a 1-by-3 RGB triplet in the range [0,1] or a long or short color name.
Version History
Introduced in R2015a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)