contrib/brl/bseg/brip/brip_histogram.h
Go to the documentation of this file.
00001 // This is brl/bseg/brip/brip_histogram.h
00002 #ifndef brip_histogram_h_
00003 #define brip_histogram_h_
00004 //:
00005 // \file
00006 // \brief Calculate various special types of histograms
00007 // \author Matt Leotta
00008 //
00009 
00010 #include <vil/vil_image_view.h>
00011 #include <vcl_vector.h>
00012 
00013 
00014 //: Construct histogram from pixels in the given image.
00015 //  same as vil_histogram except that it returns the sum
00016 //  of all values in the histogram.
00017 template<class T>
00018 double brip_histogram(const vil_image_view<T>& image,
00019                       vcl_vector<double>& histo,
00020                       double min, double max, unsigned n_bins);
00021 
00022 
00023 //: Construct weighted histogram from pixels in the given image using
00024 //  values in an image of weights.  The sum of all weights used is returned.
00025 template<class T>
00026 double brip_weighted_histogram(const vil_image_view<T>& image,
00027                                const vil_image_view<double>& weights,
00028                                vcl_vector<double>& histo,
00029                                double min, double max, unsigned n_bins);
00030 
00031 
00032 //: Construct the joint histogram between image1 and image2.
00033 //  The the values of min, max, and n_bins are used on both images
00034 //  the result is a 2D (n_bins x n_bins) vcl_vector.
00035 //  The sum of all values in the histogram is returned.
00036 template<class T>
00037 double brip_joint_histogram(const vil_image_view<T>& image1,
00038                             const vil_image_view<T>& image2,
00039                             vcl_vector<vcl_vector<double> >& histo,
00040                             double min, double max, unsigned n_bins);
00041 
00042 #endif // brip_histogram_h_