cv.calcMotionGradient - MATLAB File Help |
Calculates a gradient orientation of a motion history image
[mask, orientation] = cv.calcMotionGradient(mhi, delta1, delta2)
[...] = cv.calcMotionGradient(..., 'OptionName', optionValue, ...)
mhi
values
within a pixel neighorhood.mhi
values
within a pixel neighorhood. That is, the function finds the minimum
(m(x,y)
) and maximum (M(x,y)
) mhi
values over 3x3 neighborhood of
each pixel and marks the motion orientation at (x,y)
as valid only if:
min(delta1,delta2) <= M(x,y) - m(x,y) <= max(delta1,delta2)
uint8
and the same size a
mhi
. Its non-zero elements mark pixels where the motion gradient data is
correct.mhi
. Each pixel of the image is a motion
orientation, from 0 to 360 degrees.The function calculates a gradient orientation at each pixel (x,y)
as:
orientation(x,y) = arctan((dmhi / dy) / (dmhi / dx))
In fact, fastAtan2
and phase
are used so that the computed angle is
measured in degrees and covers the full range 0..360. Also, the mask is
filled to indicate pixels where the computed angle is valid.