KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
color_likelihood.h
Go to the documentation of this file.
1 /* $Id: color_likelihood.h 10622 2011-09-29 19:50:53Z predoehl $ */
35 /* =========================================================================== *
36  |
37  | Copyright (c) 1994-2010 by Kobus Barnard (author)
38  |
39  | Personal and educational use of this code is granted, provided that this
40  | header is kept intact, and that the authorship is not misrepresented, that
41  | its use is acknowledged in publications, and relevant papers are cited.
42  |
43  | For other use contact the author (kobus AT cs DOT arizona DOT edu).
44  |
45  | Please note that the code in this file has not necessarily been adequately
46  | tested. Naturally, there is no guarantee of performance, support, or fitness
47  | for any particular task. Nonetheless, I am interested in hearing about
48  | problems that you encounter.
49  |
50  | Author: Ernesto Brau
51  * =========================================================================== */
52 
53 #ifndef KJB_COLOR_LIKELIHOOD_H_
54 #define KJB_COLOR_LIKELIHOOD_H_
55 
56 #include "i_cpp/i_image.h"
57 #include "m_cpp/m_int_matrix.h"
58 
59 #include <vector>
60 #include <list>
61 #include <map>
62 #include <utility>
63 
69 namespace kjb {
70 
74 typedef std::list<std::pair<int, int> > Region;
75 
79 typedef std::vector<Region> Region_vector;
80 
84 std::map<int, Region_vector> get_regions_from_mask(const Int_matrix& mask, int region_length);
85 
92 {
93 private:
94  Image m_image;
95 
96 public:
98  Color_likelihood(const Image& image) : m_image(image)
99  {}
100 
102  Color_likelihood(const Color_likelihood& cl) : m_image(cl.m_image)
103  {}
104 
107  {
108  if(&cl != this)
109  {
110  m_image = cl.m_image;
111  }
112 
113  return *this;
114  }
115 
118 
120  double operator()(const std::map<int, Region_vector>& object_regions);
121 
122 };
123 
124 } // namespace kjb
125 
126 #endif /* KJB_COLOR_LIKELIHOOD_H_ */
127 
double operator()(const std::map< int, Region_vector > &object_regions)
Calculates the log likelihood of the image edge set.
Definition: color_likelihood.cpp:60
Color_likelihood(const Image &image)
Constructor.
Definition: color_likelihood.h:98
Functor that computes the likelihood of a set of projected faces onto an image, using the color distr...
Definition: color_likelihood.h:91
This class implements matrices, in the linear-algebra sense, restricted to integer-valued elements...
Definition: l_int_matrix.h:71
Color_likelihood(const Color_likelihood &cl)
Copy constructor.
Definition: color_likelihood.h:102
std::list< std::pair< int, int > > Region
Later...
Definition: color_likelihood.h:74
Color_likelihood & operator=(const Color_likelihood &cl)
Assignment operator.
Definition: color_likelihood.h:106
std::vector< Region > Region_vector
Later...
Definition: color_likelihood.h:79
~Color_likelihood()
Destructor.
Definition: color_likelihood.h:117
Code for a wrapper class around the C struct KJB_Image.
Wrapped version of the C struct KJB_image.
Definition: i_image.h:76
std::map< int, Region_vector > get_regions_from_mask(const Int_matrix &mask, int region_length)
Later...
Definition: color_likelihood.cpp:28