📄 mainfrm.h
字号:
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__801240A2_2094_4043_88B2_9F12569EDBFF__INCLUDED_)
#define AFX_MAINFRM_H__801240A2_2094_4043_88B2_9F12569EDBFF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//--------------------------------------------------------------
#include<vfw.h>
typedef struct{
// int headsize; //bitmap headsize
unsigned char buffer[6400000]; //bitmap head and data
BITMAPINFOHEADER bitmapinfoheader; //文件信息头
DWORD VideoFormatSize;
}DIBINFO,*PDIBINFO;
//-----------------------------------------------------------
class CMainFrame : public CFrameWnd
{
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame);
// Attributes
public:
//------------------------------------------------------------
DIBINFO m_dibinfo;
CFrameWnd m_wndSource;
HWND m_hWndCap;
CAPDRIVERCAPS m_caps;
BOOL m_iscapture;
void ChangeSize();
BITMAPINFOHEADER m_bitmapheader;
//存放"以YCrCb色彩空间表达的数据信息"的信息头信息;
unsigned char m_ycc_buffer[6000000];
//存放以YCrCb色彩空间表达的数据信息;
BITMAPINFOHEADER m_rgb_bitmapheader;
//存放"以RGB色彩空间表达的数据信息"的信息头信息;
unsigned char m_rgb_buffer[6000000];
//存放视频帧的数据信息,以来进行人脸检测操作;
int m_x1,m_x2,m_y1,m_y2;
//记x1为人脸的左边界,x2为人脸的右边界
//y1为人脸的下边界,y2,为人脸的上边界;
//-------------------------------------------------------------
long m_bhist[256],m_ghist[256],m_rhist[256];
long m_yhist[256],m_crhist[256],m_cbhist[256];
void rgb_histogram();//rgb色彩空间的像素统计
void ycc_histogram();//ycc色彩空间的像素统计
BOOL m_after_skindect;
BOOL m_enable_skindect;
BOOL m_enable_facelac;
//-------------------------------------------------------------
//-------------------------------------------------------
void OnAppExit();
void OnClose();
DWORD BytePerLine(LPBITMAPINFOHEADER lpbi);
//得到每行像素所占用的字节数;
long PixelOffset(int i,int j,DWORD wBytePerLine);
//得到像素点数据在整个数据区中的偏移;
void RGBToYCrCb();
//色彩空间转换函数(RGBàYCrCb);
void Skin_detection();
//肤色识别函数;
void dilation();//膨胀操作;
void erosion();//腐蚀操作;
int ErasionFalseArea();//去掉非人脸的区域;
void RecursiveCal(unsigned char * lpData,int y,int x,DWORD wBytesPerLine,int * pixelNum,int num);
//递归统计该区域连续的白色点像素点个数;
void scan();//扫描函数
void RGB_Copydata();//把RGB空间的视频帧数据信息拷贝到m_rgb_buffer[6000000]中;
void RGB_Skin_detection();//RGB空间的肤色识别公式
//-------------------------------------------------------
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnFormat();
afx_msg void OnPreview();
afx_msg void OnSource();
afx_msg void OnCapture();
afx_msg void OnFace();
afx_msg void OnFacelocation();
afx_msg void OnVideofacelac();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__801240A2_2094_4043_88B2_9F12569EDBFF__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -