www.pudn.com > Gesture[20040824].rar > HandGesture.h


// HandGesture.h: interface for the CHandGesture class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_HANDGESTURE_H__FD0FFBEA_C932_4E35_9D9B_E8EA72F4DE4D__INCLUDED_) 
#define AFX_HANDGESTURE_H__FD0FFBEA_C932_4E35_9D9B_E8EA72F4DE4D__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
#include  
#include "image.h" 
#include "background.h" 
#include "skincolor.h" 
#include "private.h" 
 
class CHandGesture   
{ 
private: 
	CBackground *background; 
	CSkinColor *skin; 
	/////////////////////////////////////////// 
	// The pointers of Image to be used 
	CImage *m_HandBin; 
	//CImage *m_FeatureImage; 
	//CImage *m_CompositedImage; 
	/////////////////////////////////////////// 
	// The Features of Gestures to be used 
	CvStatisticFeatures m_StatisticHandFeatures; 
	CvContourFeatures   m_ContourHandFeatures; 
 
	CvSeq *m_HandContour; 
	/////////////////////////////////////////// 
	// The Threshold used to recognize 
	int Th_Kcurv; 
	int Th_Kstep; 
 
	bool m_bFindChange; 
 
	CvMemStorage *ContourStorage; 
 
public: 
	CHandGesture(CBackground *bkg, CSkinColor *skincolor); 
	virtual ~CHandGesture(); 
 
	CImage *GetHnadBinImage(void) 
	{ return m_HandBin; } 
 
	CvStatisticFeatures *GetStatisticHandFeatures(void) 
	{ return &m_StatisticHandFeatures; } 
 
	CvContourFeatures *GetContourHandFeatures(void) 
	{ return &m_ContourHandFeatures; } 
 
	CvSeq *GetContours() { return m_HandContour; } 
 
	bool isChangeFound() 
	{ return m_bFindChange; } 
 
	void Initialize(int width, int height); 
 
	void ExtractHandRegion( IplImage * ); 
	void ExtractStatisticFeatures( ); 
	void ExtractContourFeatures( );  
	void ExtractMaxLenContour( CvSeq *Contours, CvSeq **MaxContour ); 
	void ExtractHandTips(CvSeq *contour, int step); 
 
	int  CalculateKCurvature( CvPoint, CvPoint, CvPoint ); 
	void DrawStatisticFeaturesToImage( IplImage * );  
	void DrawContourFeaturesToImage( IplImage * );  
}; 
 
#endif // !defined(AFX_HANDGESTURE_H__FD0FFBEA_C932_4E35_9D9B_E8EA72F4DE4D__INCLUDED_)