TarzaNN
TarzaNN neural network simulator
|
00001 /* The Histogram class is an array-based class which calculates and stores a histogram of filter responses over an image. 00002 Author: Calden Wloka 00003 */ 00004 00005 #ifndef HISTOGRAM_H_INCLUDED 00006 #define HISTOGRAM_H_INCLUDED 00007 00008 #include "common.h" 00009 00010 class Histogram { 00011 friend class FeaturePlaneHistogram; 00012 00013 protected: 00014 //constructor 00015 Histogram(int numBins); 00016 00017 // histogram parameters 00018 float minVal; //the minimum edge of the minimum value bin 00019 float maxVal; //the maximum edge of the maximum value bin 00020 float binWidth; // the range of values going into each bin 00021 int numBins; // the number of bins in the histogram 00022 int numSamples; // the number of total samples which have been included in the histogram. 00023 float *histArray; // the actual histogram array 00024 00025 // set the parameters all at once 00026 void setParams(float minVal, float maxVal); 00027 00028 // add an element to the histogram 00029 void addElement(float value); 00030 00031 // return the probability value for the bin in which value falls 00032 float returnProb(float value); 00033 00034 // finalize the histogram to be a probability map 00035 void finalizeHistogram(); 00036 00037 //destructor 00038 ~Histogram(); 00039 }; 00040 00041 00042 #endif /*HISTOGRAM_H_INCLUDED*/