KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pt_camera_prior.h
Go to the documentation of this file.
1 /* =========================================================================== *
2 |
3 | Copyright (c) 1994-2008 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 * =========================================================================== */
17 
18 /* $Id$ */
19 
20 #ifndef PT_CAMERA_PRIOR_H_
21 #define PT_CAMERA_PRIOR_H_
22 
25 #include <prob_cpp/prob_pdf.h>
26 
27 namespace kjb {
28 namespace pt {
29 
32 {
33 public:
35  (
36  double m_h,
37  double s_h,
38  double m_p,
39  double s_p,
40  double m_f,
41  double s_f
42  ) :
43  N_h(m_h, s_h),
44  N_p(m_p, s_p),
45  N_f(m_f, s_f)
46  {}
47 
48  double operator()(const Perspective_camera& camera) const
49  {
50  return log_pdf(N_h, camera.get_camera_centre()[1])
51  + log_pdf(N_p, camera.get_pitch())
52  + log_pdf(N_f, camera.get_focal_length());
53  }
54 
55  const Normal_distribution& height_prior() const { return N_h; }
56  const Normal_distribution& pitch_prior() const { return N_p; }
57  const Normal_distribution& focal_length_prior() const { return N_f; }
58 
59 private:
63 };
64 
65 }} //namespace kjb::pt
66 
67 #endif /*PT_CAMERA_PRIOR_H_ */
68 
double get_focal_length() const
returns the focal length
Definition: perspective_camera.h:218
Definition of various standard probability distributions.
Camera_prior(double m_h, double s_h, double m_p, double s_p, double m_f, double s_f)
Definition: pt_camera_prior.h:35
double operator()(const Perspective_camera &camera) const
Definition: pt_camera_prior.h:48
St_perspective_camera for modeling a perspective camera using the classic Forsyth and Ponce parametri...
PDFs and CDFs for the different distributions defined in "prob_distribution.h".
Definition: perspective_camera.h:93
double log_pdf(const MV_gaussian_distribution &P, const Vector &x)
Computes the log PDF a multivariate normal distribution at x.
Definition: prob_pdf.cpp:64
double get_pitch() const
returns the pitch angle in radian
Definition: perspective_camera.h:206
Class that represents the camera prior.
Definition: pt_camera_prior.h:31
const kjb::Vector & get_camera_centre() const
returns the camera centre
Definition: perspective_camera.h:194
const Normal_distribution & height_prior() const
Definition: pt_camera_prior.h:55
boost::math::normal Normal_distribution
Definition: prob_distribution.h:68
const Normal_distribution & focal_length_prior() const
Definition: pt_camera_prior.h:57
const Normal_distribution & pitch_prior() const
Definition: pt_camera_prior.h:56