contrib/mul/mipa/mipa_orientation_histogram.h
Go to the documentation of this file.
00001 #ifndef mipa_orientation_histogram_h_
00002 #define mipa_orientation_histogram_h_
00003 //:
00004 // \file
00005 // \brief Functions to compute histogram of orientations (HOGs)
00006 // \author Tim Cootes
00007 
00008 #include <vil/vil_image_view.h>
00009 
00010 //: Generate an image containing histograms of oriented gradients (HOG)
00011 //  At each pixel in src, compute angle and quantise into n_angles.
00012 //  If full360, then angle range is 0-360, else it is 0-180.
00013 //  hog_image is set to have n_angles planes.
00014 //  hog_image(i,j,k) gives the weighted sum of pixels with angle k
00015 //  in cell (i,j), corresponding to the i,j-th cell_size square block.
00016 //
00017 //  The corner of cell(0,0) is at src(1,1), to ignore border pixels.
00018 //
00019 //  Number of cells (size of hog_image) chosen so every cell entirely
00020 //  within src.  Thus hog_image.ni()=(src.ni()-2)/cell_size.
00021 //  If  bilin_interp=true then histogram contributions are added to neighbouring bins
00022 //  with weights inversely related to distance to centre of bin
00023 template<class srcT, class sumT>
00024 void mipa_orientation_histogram(const vil_image_view<srcT>& src,
00025                                 vil_image_view<sumT>& hog_image,
00026                                 unsigned n_angles,
00027                                 unsigned cell_size,
00028                                 bool full360=true,
00029                                 bool bilin_interp=true);
00030 
00031 #endif // mipa_orientation_histogram_h_
00032