gmm.h

来自「动态场景中运动目标检测提取与跟踪 对新手很有用」· C头文件 代码 · 共 56 行

H
56
字号
#ifndef GMM_H
#define GMM_H

#include "GM.h"
#include "cv.h"
#include "highgui.h"
#include <fstream.h>
/**
 *this implements the new GMM algorithm.
 */

#define    K               5
#define    T               0.7
#define    ALPHA_RGB       0.3

struct GMS
{
	GM gm[K];
};
class GMM
{
public:
	int height;
	int width;
	GMS* gmm;  
    IplImage* pImage;
	IplImage* pResultImage;
	char* originalImgMat;//3*height*width 大小
	char* resultImgMat;//同上
	CvCapture* pCapture;
	//char xt[3];
    int xt[3];

	
	
public:
	GMM(CvCapture* pCapture);
	~GMM();
	/**
	*find match of pixel xt
	*@param xt the current pixel
	*@param g the mixture models correspond to xt
	*return the location of the match if find, or return a number larger than K
	*/
	int findMatch(int* xt, GMS& g);
	// reorder the GMM using the parameter of w
	void reorderGMM(GMS& g);
	GM createNewGM(int* xt);
	void processImage();
	



};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?