Vous êtes sur la page 1sur 5

# OpenVision Library Gaussian Mixture Implementation

Pi19404
March 2, 2014

. . . . . . . . . . .1 3 3 5 5 2|5 . .Contents Contents OpenVision Library Gaussian Mixture Implementation Introduction . . 0. . . . . . . . . . . . . . . . . . . . . 0. . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Code .1. . . . . . . . . . . . . . . . . . .

usually Gaussian.  . These component functions are combined to provide a multimodal density. Mixture Models are a type of density model which comprise a number of component functions. k . L(X j. ¦k ))  A gaussian mixture model is characterized by  Number of mixture components  Weights of mixtures  Mean and covariances of individual mixture components Thus given the model parameters computation of probability that a vector is sampled from the gaussian mixture model is fairly simple  3|5 . w) = log P exp(logw k k + logN (X. ¦. GMM is a weighted average of gaussians where gaussian by its own mean can covariance matrix matrix The mixture density is given by P (X j. w) = P w N (X.OpenVision Library Gaussian Mixture Implementation OpenVision Library Gaussian Mixture Implementation 0. Instead of probability we can compute the log likelyhood of gaussian components which would simply be the log of sum of weighted exponentials. ¦ ) k k k k To compute the likelyhood that a random variable is sampled from the mixture model we just need to compute the probability of individual gaussian component and then find the weighted average. ¦.1 Introduction        In this article we will look at gaussian mixture model.

i++) { // cerr << _weights[i] << endl.resize(_nmix).Prob(X)).5]. res=res+_weights[i]*(_components[i].i++) { // cerr << _weights[i] << endl. res[i]=(_components[i]. SIGMA1 = [2 0. for(int i=0.Prob(X)). }  For example if we consider the following mixture models MU1 = [1 2]. } /** * @brief Prob : method computes the probability that vector X * is drawn from the gaussian mixture model * @param X : input vector X * @return */ float Prob(Mat X) { float res=0. 0 .i<_nmix. /** * @brief ProbMix:method returns the probability that * vector X belongs to each of mixture gaussian * @param X : input vector X * @return :output vector of probabilities */ vector<float> ProbMix(Mat X) { vector<float> res. } return res. for(int i=0. SIGMA2 = [1 0. MU2 = [-3 -5]. res.i<_nmix. 0 1]. 4|5 .OpenVision Library Gaussian Mixture Implementation vector<Gaussian> components. } return res.

   The probability that vector X belongs to GMM is computed as 0:0580374 using the method Prob The probability that vector X belongs to individual mixture components is computed as 0:145093 : 9:5455e   17 Both the above results can be verified by manual calculation or other packages etc.hpp files.computer vision.4 0. OpenVision is attempt at a opensource C/C++ Library developed in C/C++ using OpenCV.1 Code   The code for the same can be found in OpenVision git repository https://github.Eigen etc providing modular interface for image processing. 0.1.3].6].OpenVision Library Gaussian Mixture Implementation priors=[0.com/pi19404/OpenVision in files ImgMl/gaussianmixture. X=[1.1 2.machine learning applications.cpp and ImgMl/gaussianmixture. 5|5 .