Function opencv::optflow::segment_motion
source · pub fn segment_motion(
mhi: &dyn ToInputArray,
segmask: &mut dyn ToOutputArray,
bounding_rects: &mut Vector<Rect>,
timestamp: f64,
seg_thresh: f64
) -> Result<()>
Expand description
Splits a motion history image into a few parts corresponding to separate independent motions (for example, left hand, right hand).
Parameters
- mhi: Motion history image.
- segmask: Image where the found mask should be stored, single-channel, 32-bit floating-point.
- boundingRects: Vector containing ROIs of motion connected components.
- timestamp: Current time in milliseconds or other units.
- segThresh: Segmentation threshold that is recommended to be equal to the interval between motion history “steps” or greater.
The function finds all of the motion segments and marks them in segmask with individual values (1,2,…). It also computes a vector with ROIs of motion connected components. After that the motion direction for every component can be calculated with calcGlobalOrientation using the extracted mask of the particular component.