KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cv_histogram.h
Go to the documentation of this file.
1 /* =========================================================================== *
2  |
3  | Copyright (c) 1994-2011 by Kobus Barnard (author)
4  |
5  | Personal and educational use of this code is granted, provided that this
6  | header is kept intact, and that the authorship is not misrepresented, that
7  | its use is acknowledged in publications, and relevant papers are cited.
8  |
9  | For other use contact the author (kobus AT cs DOT arizona DOT edu).
10  |
11  | Please note that the code in this file has not necessarily been adequately
12  | tested. Naturally, there is no guarantee of performance, support, or fitness
13  | for any particular task. Nonetheless, I am interested in hearing about
14  | problems that you encounter.
15  |
16  | Author: Kyle Simek, Jinyan Guan
17  * =========================================================================== */
18 
19 /* $Id: cv_histogram.h 15022 2013-07-28 22:31:58Z jguan1 $ */
20 
21 #ifndef CV_HISTOGRAM_H_
22 #define CV_HISTOGRAM_H_
23 
24 #include <m_cpp/m_vector.h>
25 #include <i_cpp/i_image.h>
27 
28 #ifdef KJB_HAVE_OPENCV
29 #include <wrap_opencv_cpp/cv.h>
30 #endif
31 
32 #include <vector>
33 
34 namespace kjb
35 {
36 namespace opencv
37 {
38 
40 
50 (
51  const Matrix& src,
52  int num_bins,
53  float lower_bound = 0.0f,
54  float upper_bound = 256.0f
55 );
56 
66 (
67  const Image& img,
68  const Axis_aligned_rectangle_2d& box,
69  int red_bins,
70  int green_bins
71 );
72 
82 (
83  const Image& img,
84  const Axis_aligned_rectangle_2d& box,
85  int hue_bins,
86  int saturation_bins
87 );
88 
96 std::vector<Matrix> calculate_rg_histograms
97 (
98  const Image& img,
99  const std::vector<Axis_aligned_rectangle_2d> & boxes,
100  int red_bins,
101  int green_bins
102 );
103 
112 std::vector<Matrix> calculate_hs_histograms
113 (
114  const Image& img,
115  const std::vector<Axis_aligned_rectangle_2d> & boxes,
116  int hue_bins,
117  int saturation_bins
118 );
119 
120 double compare_histograms(const Matrix& h1, const Matrix& h2, int method);
121 
122 }
123 } // namespace kjb::opencv
124 #endif
125 
Matrix calculate_hs_histogram(const Image &img, const Axis_aligned_rectangle_2d &box, int hue_bins, int saturation_bins)
Calculates a histogram of values in src.
Definition: cv_histogram.cpp:231
Class that represents an axis-aligned 2D rectangle. It is defined in terms of its (2D) center...
Definition: gr_2D_bounding_box.h:51
Matrix calculate_histogram(const Matrix &src, int num_bins, float lower_bound=0.0f, float upper_bound=256.0f)
Calculates a histogram of values in src.
Matrix calculate_rg_histogram(const Image &img, const Axis_aligned_rectangle_2d &box, int red_bins, int green_bins)
Calculates a histogram of values in src.
Definition: cv_histogram.cpp:106
Definition: cv_histogram.h:39
Definition: cv_histogram.h:39
HIST_COMP_METHOD
Definition: cv_histogram.h:39
Definition: cv_histogram.h:39
double compare_histograms(const Matrix &h1, const Matrix &h2, int method)
Definition: cv_histogram.cpp:73
std::vector< Matrix > calculate_rg_histograms(const Image &img, const std::vector< Axis_aligned_rectangle_2d > &boxes, int red_bins, int green_bins)
Calculates a histogram of values in src.
Definition: cv_histogram.cpp:312
Class representing an axis-aligned, 2D rectangle.
This class implements matrices, in the linear-algebra sense, with real-valued elements.
Definition: m_matrix.h:94
Code for a wrapper class around the C struct KJB_Image.
Wrapped version of the C struct KJB_image.
Definition: i_image.h:76
Definition for the Vector class, a thin wrapper on the KJB Vector struct and its related functionalit...
std::vector< Matrix > calculate_hs_histograms(const Image &img, const std::vector< Axis_aligned_rectangle_2d > &boxes, int hue_bins, int saturation_bins)
Calculates a histogram of values in src.
Definition: cv_histogram.cpp:423
Definition: cv_histogram.h:39