forked from yangyangHu/LipSegmentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGMM.h
52 lines (37 loc) · 1.12 KB
/
GMM.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* GrabCut implementation source code Copyright(c) 2005-2006 Justin Talbot
*
* All Rights Reserved.
* For educational use only; commercial use expressly forbidden.
* NO WARRANTY, express or implied, for this software.
*/
/**********************************************************************************
*
* GMM
* by Hu yangyang 2016/1/12
*
***********************************************************************************/
#ifndef GMM_H
#define GMM_H
#include "Color.h"
#include "GaussianFitter.h"
#include <vector>
using namespace std;
typedef unsigned int uint;
class GMM
{
public:
// Initialize GMM with number of gaussians desired.
GMM(unsigned int K);
~GMM();
unsigned int K() const { return mK; }
// Returns the probability density of color c in this GMM
Real p(Color c);
// Returns the probability density of color c in just Gaussian k
Real p(unsigned int i, Color c);
int Build(double** data, uint nrows);
private:
unsigned int mK; // number of gaussians
GaussianPDF* mGaussians; // an array of K gaussians
};
#endif //GMM_H