[][src]Function opencv::video::cam_shift

pub fn cam_shift(
    prob_image: &dyn ToInputArray,
    window: &mut Rect,
    criteria: &TermCriteria
) -> Result<RotatedRect>

Finds an object center, size, and orientation.

Parameters

  • probImage: Back projection of the object histogram. See calcBackProject.
  • window: Initial search window.
  • criteria: Stop criteria for the underlying meanShift. returns (in old interfaces) Number of iterations CAMSHIFT took to converge The function implements the CAMSHIFT object tracking algorithm Bradski98 . First, it finds an object center using meanShift and then adjusts the window size and finds the optimal rotation. The function returns the rotated rectangle structure that includes the object position, size, and orientation. The next position of the search window can be obtained with RotatedRect::boundingRect()

See the OpenCV sample camshiftdemo.c that tracks colored objects.

Note:

  • (Python) A sample explaining the camshift tracking algorithm can be found at opencv_source_code/samples/python/camshift.py