www.pudn.com > Blur-Detection-Using-Wavelet.rar > wavelet.h, change:2010-07-13,size:5104b


#ifndef WAVELET_H_ 
#define WAVELET_H_ 
 
#include"common.h" 
  
class Wavelet 
{ 
	public: 
		 
		/******************************************************************************** 
		FUNCTION: Wavelet 
		PURPOSE:  construct the wavelet class  
		PARAMETERS: NULL 
		RETURN TYPE: NULL 
		HISTORY:  Qiuchuan Qin    2010-7-5 
		********************************************************************************/ 
		Wavelet(); 
 
 
		/******************************************************************************** 
		FUNCTION: ~Wavelet 
		PURPOSE:  deconstruct the wavelet class  
		PARAMETERS: NULL 
		RETURN TYPE: NULL 
		HISTORY:  Qiuchuan Qin    2010-7-5 
		********************************************************************************/ 
		~Wavelet(); 
 
		/******************************************************************************** 
		FUNCTION: Destroy 
		PURPOSE:  release the memories of all pointers  
		PARAMETERS: NULL 
		RETURN TYPE: NULL 
		HISTORY:  Qiuchuan Qin    2010-7-5 
		********************************************************************************/ 
		void Destroy(); 
 
 
 
		/******************************************************************************************** 
		FUNCTION: Initial 
		PURPOSE:  set the value of srcImage/grayImage/haarImage/llImage/lhImage/hlImage/hhImage and so on  
		PARAMETERS:    
				  pFrame    - the frame extracted from video 
		RETURN TYPE:  
				  true      - successfully allocate memories 
				  false     - otherwise; 
		HISTORY:  Qiuchuan Qin    2010-7-5 
		*********************************************************************************************/ 
		bool Initial(IplImage* pFrame); 
 
 
 
		/******************************************************************************************** 
		FUNCTION: HaarEncode2D 
		PURPOSE:  the 2D haar wavelet transform 
		PARAMETERS:   NULL 
		RETURN TYPE:   
				true      - successfully 2D haar wavelet transform the image 
				false     - otherwise; 
		HISTORY:  Qiuchuan Qin    2010-7-5 
		*********************************************************************************************/ 
		bool HaarEncode2D();		 
 
 
 
		/******************************************************************************************** 
		FUNCTION: PreHandle 
		PURPOSE:  prehandle the original image 
		PARAMETERS:   NULL 
		RETURN TYPE:   
				true      - successfully prehandle the gray image 
				false     - otherwise; 
		HISTORY:  Qiuchuan Qin    2010-7-5 
		*********************************************************************************************/ 
		bool PreHandle();	 
 
 
 
		/******************************************************************************************** 
		FUNCTION: ComputeBlurExtent 
		PURPOSE:  compute the blur extent 
		PARAMETERS:   NULL 
		RETURN TYPE:   
				true      - successfully compute the blur extent 
				false     - otherwise; 
		HISTORY:  Qiuchuan Qin    2010-7-5 
		*********************************************************************************************/ 
		bool ComputeBlurExtent();                                        
 
 
 
		/******************************************************************************************** 
		FUNCTION: OutputResults 
		PURPOSE:  printf the blur extent to the file 
		PARAMETERS:    
				filename   - the output results file 
		RETURN TYPE:   
				NULL 
		HISTORY:  Qiuchuan Qin    2010-7-5 
		*********************************************************************************************/ 
		void OutputResults(char* filename); 
 
		 
	 
		 
 
	private: 
		int m_nImageWidth;          // the original image width 
		int m_nImageHeight;         // the original image height 
		int m_nDecomposeStage;      // the haar decompose stage 
		int m_nFilterLen;           // the filter length 
 
				 
		IplImage* srcImage;		    // the original image 
		IplImage* grayImage;        // the gray image 
		IplImage** llImage; 		// the LL value of the haar  
		IplImage** lhImage;			// the LH value of the haar  
		IplImage** hlImage;			// the HL value of the haar  
		IplImage** hhImage;          // the HH value of the haar  
		IplImage* haarImage;        // the haar image 
		float** image;             // the image data 
		float *tempRow;            // the temp vector for row decompose 
		float *tempCol;			// the temp vector for col decompose 
		float* hParameters;					// h parameters  
		float* gParameters;					// g parameters 
		float*** edgeMap;			// the edge map 
		float*** edgeMaxMap;		// the max edge map 
		int m_nFrameNumber;         // the number of temp frame 
		int m_nDirac_Astep;			// the number of Dirac_Astep edge 
		int m_nGstep_Roof;			// the number of Gstep_Roof edge 
		int m_nbGstep_Roof;			// the number of bGstep_Roof edge 
		int m_nEdge;				// the number of the total edges 
		float m_dBlurExtent;		// the blur extent 
		float m_dRofDA;			// the ratio of Dirac_Astep edge   
		float h[30];     
 
        // private function 
		void DecompStageRow(int row, int stage);			// the row decompose function 
		void DecompStageCol(int col, int stage);		    // the col decompose function 
	 
}; 
 
 
#endif