# Revision history [back]

### Calculate weight of a cluster in Opencv

Dear forum followers I have a issue which I don't know how deal with it.

I'm developing a tracker (track people in videos) from a particle filter. I have particles along the image and I cluster them using EM (http://docs.opencv.org/modules/ml/doc/expectation_maximization.html#ml-expectation-maximization) in Opencv.

After clustering, I can check the next values about the output clusters:

• Mean of the cluster (position)
• Weight of the cluster
• Covariance of the clusters

At this point everything is fine.

After I modify some of this clusters and particles and the final step would be recalculate mean, weight and covariance. I calculcate these variables:

• Mean: calculating the average position of the particles.
• Covariance: calculateing the covariance of the particles.
• Weight: here is my doubt... HOW can I calculate the weight of each cluster??

I hope you can help me!!! Thank in advanced!!!

### Calculate weight of a cluster in Opencv

Dear forum followers I have a issue which I don't know how deal with it.

I'm developing a tracker (track people in videos) from a particle filter. I have particles along the image and I cluster them using EM (http://docs.opencv.org/modules/ml/doc/expectation_maximization.html#ml-expectation-maximization) in Opencv.

After clustering, I can check the next values about the output clusters:

• Mean of the cluster (position)
• Weight of the cluster
• Covariance of the clusters

At this point everything is fine.

After I modify some of this clusters and particles and the final step would be recalculate mean, weight and covariance. I calculcate these variables:

• Mean: calculating the average position of the particles.
• Covariance: calculateing the covariance of the particles.
• Weight: here is my doubt... HOW can I calculate the weight of each cluster??

Extend information: I'm currently doing: - I call trainE - I modify things using these results like the labels... -And I want calculate the weight of the clusters; with the labels modified...

I hope you can help me!!! Thank in advanced!!!