segmentation
All Data Structures Namespaces Files Functions Variables Modules Pages
histogram.h
1 #ifndef HISTOGRAM_HPP_
2 #define HISTOGRAM_HPP_
3 
6 
7 /*
8  * Copyright (C) 2015 Department of iCub Facility - Istituto Italiano di Tecnologia
9  * Author: Vadim Tikhanoff
10  * email: vadim.tikhanoff@iit.it
11  * Permission is granted to copy, distribute, and/or modify this program
12  * under the terms of the GNU General Public License, version 2 or any
13  * later version published by the Free Software Foundation.
14  *
15  * A copy of the license can be found at
16  * http://www.robotcub.org/icub/license/gpl.txt
17  *
18  * This program is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
21  * Public License for more details
22  */
23 
24 #include <opencv2/opencv.hpp>
25 #include <limits>
26 
27 namespace lbp {
28 
29 // templated functions
30 template <typename _Tp>
31  void histogram_(const cv::Mat& src, cv::Mat& hist, int numPatterns);
32 
33 template <typename _Tp>
34 double chi_square_(const cv::Mat& histogram0, const cv::Mat& histogram1);
35 
36 // non-templated functions
37 void spatial_histogram(const cv::Mat& src, cv::Mat& spatialhist, int numPatterns, const cv::Size& window, int overlap=0);
38 
39 // wrapper functions
40 void spatial_histogram(const cv::Mat& src, cv::Mat& spatialhist, int numPatterns, int gridx=8, int gridy=8, int overlap=0);
41 void histogram(const cv::Mat& src, cv::Mat& hist, int numPatterns);
42 double chi_square(const cv::Mat& histogram0, const cv::Mat& histogram1);
43 
44 // Mat return type functions
45 cv::Mat histogram(const cv::Mat& src, int numPatterns);
46 cv::Mat spatial_histogram(const cv::Mat& src, int numPatterns, const cv::Size& window, int overlap=0);
47 cv::Mat spatial_histogram(const cv::Mat& src, int numPatterns, int gridx=8, int gridy=8, int overlap=0);
48 }
49 #endif
Original code by philipp <bytefish[at]gmx[dot]de>
Definition: histogram.h:27
void histogram_(const cv::Mat &src, cv::Mat &hist, int numPatterns)
Original code by philipp <bytefish[at]gmx[dot]de>
Definition: histogram.cpp:28