www.pudn.com > Blur-Detection-Using-Wavelet.rar > blurFeatures.h, change:2010-07-16,size:2128b


#ifndef BLUR_FEATRUES_ 
#define BLUR_FEATRUES_ 
 
#include"common.h" 
 
 
struct ComplexNumber 
{ 
    float re; 
	float im; 
 
	ComplexNumber() 
	{ 
		re = 0.0f; 
		im = 0.0f; 
	} 
 
	ComplexNumber(float ref, float imf = 0) 
	{ 
		re = ref; 
		im = imf; 
	} 
 
	ComplexNumber(ComplexNumber& comNum) 
	{ 
		re = comNum.re; 
		im = comNum.im; 
	} 
 
	ComplexNumber& operator+ (ComplexNumber &c) 
    { 
        re = re + c.re; 
        im = im + c.im; 
        return *this; 
    } 
 
    ComplexNumber& operator- (ComplexNumber &c) 
    { 
        re = re - c.re; 
        im = im - c.im; 
        return *this; 
    } 
 
    ComplexNumber& operator* (ComplexNumber &c) 
    { 
        re = re * c.re - im * c.im; 
        im = re * c.im + im * c.re; 
        return *this; 
    } 
 
	ComplexNumber& operator= (ComplexNumber &c) 
	{ 
		re = c.re; 
		im = c.im; 
		return *this; 
	} 
}; 
 
 
class BlurFeatures 
{ 
	public: 
		BlurFeatures(); 
		~BlurFeatures(); 
		bool LocalPowerSpectrumSlope(int startPosX, int startPosY); 
		bool GradientHistogramSpan(int startPosX, int startPosY); 
		bool MaximumSaturation(int startPosX, int startPosY); 
		bool LocalAutocorrelationCongruency(int startPosX, int startPosY); 
		bool Initial(IplImage* pFrame); 
 
 
	private: 
		IplImage* srcImage;		    // the original image 
		IplImage* grayImage;        // the gray image 
		float** image;              // the image data 
		int m_nImageWidth;          // the original image width 
		int m_nImageHeight;         // the original image height 
		int m_nFrameNumber;         // the number of temp frame 
 
		float m_dMaximumSaturation;			// the maximum saturation 
		float m_dLocalAutoCongruency;		// the local auto congrency 
		float m_dGradientHistogramSpan;		// the gradient histogram span 
		float m_dLocalPowerSpectrum;		// the local power spectrum  
 
 
		bool Fourier(ComplexNumber* TD, int lWidth, int lHeight, ComplexNumber* FD); 
		bool DFT(ComplexNumber* TD, ComplexNumber* FD, int r); 
		IplImage* DiscreteFourierTransform(int startPosX = -10, int startPosY = -10); 
		float PowerSpectrumSlope(IplImage* dftImage); 
}; 
 
 
#endif