NITE 1.5.1 - API Reference

XnVPointDenoiser.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002 *                                                                              *
00003 *   PrimeSense NITE 1.3                                                        *
00004 *   Copyright (C) 2010 PrimeSense Ltd.                                         *
00005 *                                                                              *
00006 *******************************************************************************/
00007 
00008 
00009 #ifndef _XNV_POINT_DENOISER_H_
00010 #define _XNV_POINT_DENOISER_H_
00011 
00012 #include "XnVPointFilter.h"
00013 
00014 struct XnVDenoisingLocalContext;
00015 struct XnVIntLocalHash;
00016 
00023 class XNV_NITE_API XnVPointDenoiser :
00024     public XnVPointFilter
00025 {
00026 public:
00033     XnVPointDenoiser(XnFloat fDistanceThreshold = ms_fDefaultDistanceThreshold,
00034         const XnChar* strName = "XnVPointDenoiser");
00035     ~XnVPointDenoiser();
00036 
00042     void Update(XnVMessage* pMessage);
00043 
00049     void OnPointCreate(const XnVHandPointContext* pContext);
00055     void OnPointUpdate(const XnVHandPointContext* pContext);
00061     void OnPointDestroy(XnUInt32 nID);
00068     void OnPrimaryPointCreate(const XnVHandPointContext* pContext, const XnPoint3D& ptSessionStarter);
00069 
00075     XnFloat GetDistanceThreshold() const;
00081     void SetDistanceThreshold(XnFloat fDistanceThreshold);
00082 
00083     XnFloat GetCloseRatio() const;
00084     XnFloat GetFarRatio() const;
00085 
00091     void SetCloseRatio(XnFloat fCloseRatio);
00097     void SetFarRatio(XnFloat fFarRatio);
00098 
00099 protected:
00100     XnVDenoisingLocalContext* GetLocalContext(XnUInt32 nID);
00101     XnFloat Distance(XnPoint3D& pt1, XnPoint3D& pt2) const;
00102     void UpdatePointDenoise(XnPoint3D& ptToChange, const XnPoint3D& ptDontChange);
00103 
00104     void Clear();
00105 
00106     XnVIntLocalHash* m_pActivePoints;
00107 
00108     static const XnFloat ms_fDefaultDistanceThreshold;  //  = 10
00109     static const XnFloat ms_fDefaultCloseRatio;     // = 0.0
00110     static const XnFloat ms_fDefaultFarRatio;           // = 1.0
00111 
00112     XnFloat m_fDistanceThreshold;
00113     XnFloat m_fCloseRatio;
00114     XnFloat m_fFarRatio;
00115 
00116     XnVMultipleHands m_DenoisedHands;
00117 };
00118 
00119 #endif