meanShift

Finds an object on a back projection image.

C++: int meanShift (InputArray probImage, Rect& window, TermCriteria criteria )

Python: cv2. meanShift (probImage, window, criteria ) → retval, window

C: int cvMeanShift (const CvArr* prob_image, CvRect window, CvTermCriteria criteria, CvConnectedComp* comp )

Python: cv. MeanShift (prob_image, window, criteria ) → comp
Parameters:
  • probImage – Back projection of the object histogram. See calcBackProject() for details.
  • window – Initial search window.
  • criteria – Stop criteria for the iterative search algorithm.
Returns:

Number of iterations CAMSHIFT took to converge.

The function implements the iterative object search algorithm. It takes the input back projection of an object and the initial position. The mass center in window of the back projection image is computed and the search window center shifts to the mass center. The procedure is repeated until the specified number of iterations criteria.maxCount is done or until the window center shifts by less than criteria.epsilon . The algorithm is used insideCamShift() and, unlikeCamShift() , the search window size or orientation do not change during the search. You can simply pass the output ofcalcBackProject() to this function. But better results can be obtained if you pre-filter the back projection and remove the noise. For example, you can do this by retrieving connected components withfindContours() , throwing away contours with small area (contourArea() ), and rendering the remaining contours withdrawContours() .

Note

  • A mean-shift tracking sample can be found at opencv_source_code/samples/cpp/camshiftdemo.cpp
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值