Meanshift tracking algorithm and source code

Source: Internet
Author: User

Meanshift was first proposed by comaniciu and is an algorithm used to track non-rigid objects. This article is also from comaniciu. Below are some basic information of the article:

Title: Kernel-based object tracking

Authors: Dorin comaniciu, senior member, IEEE, visvanw.ramesh, Member, IEEE, and Peter Meer, senior member, IEEE

Publication: IEEE Transactions on Pattern Analysis and machine intelligence, vol. 25, No. 5, May 2003. pp564-577.

At the same time, since the formula is not easy to paste directly, if you are interested or have questions, please refer to the original article. In addition, this section only describes the main algorithms.

To characterize the target, you must first select a feature space. Reference target, which is expressed by the probability density function q in feature space. For example, the reference model can select the color probability density function of the target. The target model can be considered as the center of its space. In the next frame, the candidate target is defined as position y, which is expressed by the probability density function P (y. To meet real-time requirements, they are represented by histogram statistics ^ Q and ^ P (y) in non-parametric methods.

The similarity function between the target and the candidate histogram is recorded as the formula (1). The local maximum similarity means matching between the candidate model and the target model. If only color information is taken into account, the similarity of candidate regions will change greatly.
The configuration is ineffective. To obtain a continuous similarity function, a kernel function is used
Filter the region.

The feature probability in the target model can be calculated using equation (2), which indicates the normalized pixel position. k (x) is a convex monotonic decreasing kernel function, it allocates a small weight to the pixels far from the center, and a large weight to the pixels near the center. B indicates the position histogram index, and C indicates the normalization constant. Similarly, for the target candidate model, the same k (x) is used, but with the bandwidth H, the feature probability can be calculated using equation (4. The similarity function defines the distance between the target model and the candidate model. The similarity functions ^ P and ^ Q are expressed by bhattacharyya coefficient, formula (8, 9 ).

In the current frame, the matching position of the target model is the maximum value of the second item in equation (9. It can be seen that in the current frame, the second item of equation (9) is represented by the probability density and weight W calculated by K (x) in the kernel section of the Y position. In the neighborhood, you can use the meanshift process to find the maximum mode. In this process, the core moves from the current position ^ y0 to the new position ^ Y1 through equation (11. In this way, loop iteration achieves target tracking.

The meshift algorithm can be used to track objects in real time. However, this method is sensitive to color changes because it is based on color histograms. In addition, this method is used to search for window rules and cannot achieve large tracking, to overcome this problem, refer to camshift. opencv has examples.

Considering that the latest blog update is not timely and affects everyone's work and learning, I hereby send my favorite code to the resource for free download. After the download, if you find it helpful for your work and study, please post a comment and let others find this article well. Thank you for your support and help! Specific resources: http://download.csdn.net/detail/luckydongbin/4940.pdf.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.