iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Statistics.H
Go to the documentation of this file.
1 /*! @file
2  @author Daniel Parks <danielfp@usc.edu>
3  @copyright GNU Public License (GPL v3)
4  @section License
5  @verbatim
6  // ////////////////////////////////////////////////////////////////////////
7  // The iLab Neuromorphic Robotics Toolkit (NRT) //
8  // Copyright 2010-2012 by the University of Southern California (USC) //
9  // and the iLab at USC. //
10  // //
11  // iLab - University of Southern California //
12  // Hedco Neurociences Building, Room HNB-10 //
13  // Los Angeles, Ca 90089-2520 - USA //
14  // //
15  // See http://ilab.usc.edu for information about this project. //
16  // ////////////////////////////////////////////////////////////////////////
17  // This file is part of The iLab Neuromorphic Robotics Toolkit. //
18  // //
19  // The iLab Neuromorphic Robotics Toolkit is free software: you can //
20  // redistribute it and/or modify it under the terms of the GNU General //
21  // Public License as published by the Free Software Foundation, either //
22  // version 3 of the License, or (at your option) any later version. //
23  // //
24  // The iLab Neuromorphic Robotics Toolkit is distributed in the hope //
25  // that it will be useful, but WITHOUT ANY WARRANTY; without even the //
26  // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
27  // PURPOSE. See the GNU General Public License for more details. //
28  // //
29  // You should have received a copy of the GNU General Public License //
30  // along with The iLab Neuromorphic Robotics Toolkit. If not, see //
31  // <http://www.gnu.org/licenses/>. //
32  // ////////////////////////////////////////////////////////////////////////
33  @endverbatim */
34 
35 
36 #ifndef INCLUDE_NRT_IMAGEPROC_MATH_STATISTICS_H
37 #define INCLUDE_NRT_IMAGEPROC_MATH_STATISTICS_H
38 
39 #include <nrt/Core/Image/Image.H>
41 #include <nrt/Core/Typing/Macros.H>
42 
43 namespace nrt
44 {
45  /*! @defgroup imagemath Image Math Operations
46  Mathematical operations involving Image objects
47 
48  \ingroup imageproc
49  \see image */
50 
51 
52  /*! @defgroup imagestatistics Image Statistics
53  Functions for computing statistics on Image objects
54 
55  \ingroup imagemath
56  \see imagepromo */
57 
58  /*! @{ */ // **********************************************************************
59 
60  //! Find the maximum location in the image
61  template <class PixType>
62  Point2D<int> findMaxLocation(Image<PixType> const & src);
63 
64  //! Find the minimum location in the image
65  template <class PixType>
66  Point2D<int> findMinLocation(Image<PixType> const & src);
67 
68  //! Get the average of all input pixels.
69  template <NRT_PROMOTE_PIX(double)>
70  DestType const mean(Image<PixType> const & im);
71 
72  //! Compute standard deviation of pixel values over image
73  template <NRT_PROMOTE_PIX(double)>
74  DestType const stdev(Image<PixType> const & im);
75 
76  //! Compute variance of pixel values over image
77  template <NRT_PROMOTE_PIX(double)>
78  DestType const variance(Image<PixType> const & im);
79 
80  //! Returns the sum of all input pixels
81  template <NRT_PROMOTE_PIX(double)>
82  DestType const sum(Image<PixType> const & im);
83 
84  //! Returns the normalized cross-correlation between two images of same dims, images should have zero mean
85  template <class promo = float, class T>
86  typename nrt::promote<T, promo>::type const
87  normalizedCrossCorrelation(Image<nrt::PixGray<T> > const & im1, Image<nrt::PixGray<T> > const & im2);
88 
89  /*! @} */ // **********************************************************************
90 
91 } // namespace nrt
92 
94 
95 #endif // INCLUDE_NRT_IMAGEPROC_MATH_STATISTICS_H