Welcome to the Csdn-markdown Editor

Source: Internet
Author: User
The particle filter program essentially introduces the particle structure in the following program:
程序中粒子本质就是选取的区域,只不过该区域加上了权值,程序中构造一个结构体用来描述粒子:主要有以下属性,区域的中心、区域的长宽、区域的权值、区域的原始中心、区域前一帧的中心和长宽,区域的权值、区域的变化尺度、区域的前一帧变化尺度、区域的直方图。

1. Color space conversion of the first frame image, from BGR space to HSV space, find the need to track the region, generate the tracking area histogram.

2. Initialize particle information, set each particle information to track the initial state of the object, so that the center of the area equals the original center of the region and equal to the center of the previous frame of the region. The long width of the previous frame of the region equals the length of the previous frame of the region. The weighted value of the zone is initialized to zero. The region's change scale equals the region's previous frame change scale equal to 1.

3. Read the next frame and make predictions for each particle, and the predicted content is actually using random numbers (Gauss) to randomly change the center position and length of the region. Here you can assume that the final position and size of the area is mainly based on the last change plus a random change to get

4. The similarity between the histogram in the HSV space and the histogram of the initialized time is obtained, and the similarity is expressed by the Battacharyya coefficient, assuming that the initial graph is {0.1,0.2,0.5,0.2}, and the changed histogram is {0.2,0.2,0.4,0.2 }, the similarity is sqrt (0.1*0.2+0.2*0.2+0.5*0.4+0.2*0.2) = 0.55, where the similarity is the weight of the particles.

5. The position information and weights of all particle updates are obtained by Process four. Redistribute the range of particles according to weight, say there is a particle weight of 0.1, a total of 100 particles, then, when we redistribute the particles, at the position of the particle distribution 0.1*100=10 particles. And the state of the 10 particles is exactly the same as the particle. Where the particle weights the most can be considered to track the current position of the target.

6. Return to step 3.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Welcome to the Csdn-markdown Editor

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.