00001 #ifndef _HISTOGRAM_H_ 00002 #define _HISTOGRAM_H_ 00003 00004 class Histogram 00005 { 00006 public: 00007 Histogram(); 00008 ~Histogram(); 00009 00010 void generateFromImage(unsigned char* frame, unsigned int frameWidth, 00011 unsigned int frameHeight, unsigned int minScanX, 00012 unsigned int maxScanX, unsigned int minScanY, 00013 unsigned int maxScanY, unsigned int XSpacing, 00014 unsigned int YSpacing); 00015 float calculateSimilarityWith(const Histogram&) const; 00016 unsigned int getAverageIntensity() const; 00017 unsigned int getThresholdForPercentageOfPixels(float percentage) const; 00018 00019 // do not override default copy constructor, as the default copy 00020 // constructor will do just fine. 00021 private: 00022 int data[256]; 00023 unsigned int numberOfSamples; 00024 }; 00025 00026 #endif 00027 00028 /* vim: set expandtab tabstop=4 shiftwidth=4: */ 00029
1.5.5