kcc__
kcc__

Reputation: 1648

Computing Variance from co-variance matrix in OpenCV Expectation Max

In opencv, the result of Expectation Max is given as a co-variance matrix. In my work, I have 2 distributions where I need to compute the similarities. I want to use the variance but its given only co-variance of the number of clusters:

I have 2 question that I need help on:

  1. If my cluster is 1, than I assume that the co-variance = variance. Is it correct.?
  2. How to compute variance from co-variance for cluster > 1 (if 1 is correct)

Upvotes: 1

Views: 331

Answers (1)

Andrey  Smorodov
Andrey Smorodov

Reputation: 10852

Every cluster in your case is gaussian probability distribution density function. In onedimentional case its parameters are mean and variance.

In multidimentional case variance becomes covariance matrix.It describes ellipsoid axis directions and size.

You can reduce covariance to variance but you'll get circle or sphere instead ellipse or ellipsoid.

So ellipse axis directions will be eigenvectors of covariance matrix, and their halflengths will be square root of eigenvalues. Once you know ellipse axis you should deside the way you will convert it to circle. The radius you accept will be square root of variance.

But if you'll need compute probability you'll should compute covariance matrix from your variance by scaling identity matrix by factor equal to variance.

Upvotes: 3

Related Questions