Plot optical flow vectors
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 = 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.
flow— Object containing optical flow matrices
Object containing optical flow velocity matrices, specified as an
comma-separated pairs of
the argument name and
Value is the corresponding value.
Name must appear inside quotes. You can specify several name and value
pair arguments in any order as
DecimationFactor— Decimation factor of velocity vectors
[1 1](default) | two-element vector
Decimation factor of velocity vectors, specified as the
comma-separated pair consisting of
DecimationFactor' and 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
ScaleFactor— Scaling factor for velocity vector display
1(default) | positive integer-valued scalar
Scaling factor for velocity vector display, specified as the
comma-separated pair consisting of '
and a positive integer-valued scalar. Increase this value to display
Parent— Figure axes
Figure axes, specified as the comma-separated pair consisting of
Parent' and axes object. The default is set to
the current axes handle,