- C++08 compiler (actually used gcc/g++ 4.8.1)
- OpenCv 2.4.* with Qt 4 support
The current code was compiled on Linux but it should be straightforward to make it run also under Windows platforms.
NOTE: This code is no longer maintained. If you want to run this code with early versions of OpenCV you should modify it as the Em class is now under cv::ml::EM, not cv::EM.
Type './gmm help' to display help.
Simple Run:
> make clean && make
> ./gmm
The code reads the points from the image (samples) and fits a Gaussian Mixture Model using the Expectation Maximization algorithm in order to maximize the log probability of each sample.
After this process, the program shows two images:
- One representing the clusters, that is the 2D gaussians along with the (scaled) eigenvectors of its dimensions. The more the ellipse is white, the higher weight is assigned to that component.
- The posterior probability of each sample.
See LICENSE
The following tutorial has proved very helpful:
http://www.juergenwiki.de/work/wiki/doku.php?id=public:gaussian_mixture_models_em_algorithm_-_demo
The EM OpenCv doc page
http://docs.opencv.org/modules/ml/doc/expectation_maximization.html