www.pudn.com > several_kinds_Histogram.rar > Histogram.H


#ifndef Histogram_H 
#define Histogram_H 
 
 
#if _MSG_VER>1000 
#define pragma once 
#endif 
 
#include"..\\typedef.h" 
#include"cv.h" 
#include"highgui.h" 
class Histogram  
{ 
public: 
	Histogram():m_bc1(0),m_bc2(0),m_bc3(0),pimagedata(0),pHist(0),HistSize(0) {} 
     
 
	virtual ~Histogram(); 
 
	//初始化参数 
	bool Init(BYTE c1,BYTE c2,BYTE c3,COLORSPACE colorspace); 
	//提取特征 
    bool ExtractFeature(const string &imagename); 
    //保存特征 
    void SaveHist(const string histfile);//二进制写文件 
    void SaveHist_txt(const string histfile); 
	//	得到结果 
	bool GetHist(vector &); 
 
 
    
private: 
		bool COLORQUAN(); 
protected: 
	//private the member function 
	virtual bool ApplySpace(); 
	virtual bool ExtractHistogram(); 
	 
 
 
	//the bins of number each channel  
	BYTE m_c1,m_c2,m_c3; 
	//the bit number used for each channel 
	BYTE m_bc1,m_bc2,m_bc3; 
  
	//the image data 
    IplImage *pimagedata; 
  
    //index of the feature space 
	vector feature; 
	//the computed color histogram 
    double *pHist; 
	WORD HistSize; 
	//color space 
	COLORSPACE colorspace; 
	//Histogram file header 
	HISTFILEHEADER histfileheader; 
}; 
#endif