GravityCenter.h
上传用户:smdfuse
上传日期:2015-11-06
资源大小:98k
文件大小:3k
- #ifndef _GRAVITYCENTER_H_INCLUDED_
- #define _GRAVITYCENTER_H_INCLUDED_
- #include "StructDefine.h"
- class CGravityCenter
- {
- public:
- TARGETPARA m_result;
- public:
- CGravityCenter(int nwidth,int nheight);
- virtual ~CGravityCenter();
- void InitalObjectTracker(BOOL type, int threshold);
- void GravityCenter(int index, unsigned char * nRGBbuffer);
- private:
- int m_frame;
- int m_width,m_height;
- int m_imageSize;
- int m_threshBH, m_threshW;
- int m_threshBHD,m_threshW1,m_threshW2,m_threshW3,m_threshW4;
- unsigned char *m_CurImage; //当前RGB图像
- unsigned char *m_CurGrayImage; //当前Gray图像
- unsigned char *m_TempGrayImage; //过渡帧Gray图像
- unsigned char *m_PreGrayImage; //上一帧Gray图像
- BOOL trackflag; //捕获/跟踪切换
- WININFO m_TargetWin; //目标窗口
- WININFO m_DrawWin; //显示外接窗口
- UINT m_ObjectType; //目标类型
- UINT m_ObjectNum; //目标个数
- bool permitflag1,permitflag2,permitflag3,permitflag4;
- bool captureflag1,captureflag2,captureflag3,captureflag4;
- WININFO m_TargetWin1, m_TargetWin2, m_TargetWin3, m_TargetWin4;
- WININFO m_DrawWin1, m_DrawWin2, m_DrawWin3, m_DrawWin4;
- BOOL m_otype;
- UINT m_threshold, m_thresholdT;
- UINT m_colorType;
- public:
- int GetBHThByHistogram(unsigned char *sGray,int nWidth, int nHeight);
- int GetWThByHistogram(unsigned char *sGray, WININFO sWin, int nWidth, int nHeight);
- int GetWThByAera(unsigned char *sGray, WININFO sWin, int nWidth, int nHeight);
- WININFO project(unsigned char* sGray, int sWidth, int sHeight, int sThreshold);
- WININFO gravity(unsigned char* sGray, int sWidth, int sHeight,int sThreshold);
- WININFO findEdge(unsigned char* sGray, int sWidth, int sHeight, int sThreshold, int sBlockNum);
-
- WININFO AdjustWindow(WININFO sWin, int sWidth, int sHeight);
- void erasure(unsigned char *sGray, WININFO sWin, int sWidth, int sHeight);
- WININFO gvtrack(unsigned char* sGray, int sWidth, int sHeight, WININFO sWin, int sThreshold);
- WININFO match(int* sGray, int* sTemp, int sWidth, int sHeight, int sTWidth, int sTHeight);
- void RGBToGray(unsigned char *sRGB, unsigned char *sGray, int nWidth, int nHeight);
- void Segment(unsigned char *sGray, int nWidth, int nHeight, int nThreshold);
- void Inverse(unsigned char *sGray, int nWidth, int nHeight);
- unsigned long GetBoxColor();
- void SetPixelValues(unsigned char *sRGB,unsigned long pixelValues, int x, int y);
- void DrawObjectBox(unsigned char *sRGB, WININFO sWin);
- void SaveGrayImage(unsigned char *sGray,int nwidth, int nheight);
- void SaveRGBImage(unsigned char *sRGB,int nwidth, int nheight);
- void Initial();
- };
- #endif