Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

Histogram.h

Go to the documentation of this file.
00001 /*************************************************************************
00008  *
00009  * Source code for Real Time Image Library (libRTImage)
00010  *
00011  * Leeds Vision Group give permission for this code to be copied, modified
00012  * and distributed within the University of Leeds subject to the following
00013  * conditions:-
00014  *
00015  * - The code is not to be used for commercial gain.
00016  * - The code and use thereof will be attributed to the authors where
00017  *   appropriate (including demonstrations which rely on it's use).
00018  * - All modified, distributions of the source files will retain this header.
00019  *
00020  ****************************************************************************/
00021 
00022 #ifndef HISTOGRAM_H
00023 #define HISTOGRAM_H
00024 
00025 class Histogram
00029 {
00030 private:
00031     float                  min_val;         
00032     float                  max_val;         
00033     unsigned int           bands_per_dim;   
00034     unsigned int           dim;             
00035     unsigned int          *frequency_data;  
00036     unsigned int           no_bins;         
00037     unsigned int           no_data_items;   
00038     float                  band_size;       
00039 
00040     float                  max_prob;        
00041     unsigned int           max_freq;        
00042     
00043 protected:
00044     float                 *probs;           
00045     
00046 public:
00047     Histogram(float        minimum_data_value,
00048               float        maximum_data_value,
00049               unsigned int bands_per_dimension,
00050               unsigned int dimensionality);
00051 
00052     Histogram(char const* hstFile);
00053 
00054     unsigned int numBands (void)  { return bands_per_dim; }
00055     
00056     void        add_new_data_item (int *data); 
00057     void        add_new_data_item (float *data); 
00058     
00059     void        reset_histogram();
00060     void        calculate_probabilities();
00061     void        calculate_histogram();
00062 
00063     float       get_histogram_value  (unsigned int *bin); 
00064     float       get_mapped_value     (unsigned int *bin);
00065         
00066     float       calculate_difference (Histogram *hist);
00067 
00069     float       get_maximum_prob     (void) { return max_prob; }
00070 
00072     void        get_best_bin(unsigned int *bin) ;
00073 
00074     float       calculate_proportion_threshold(float proportion) ;
00075 
00076     void        save_histogram(char const*);
00077     void        load_histogram(char const*);
00078 };
00079 
00080 #endif
00081 

Generated at Fri Aug 13 17:29:20 2004 for libRTImage by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001