KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pt_optical_flow_likelihood.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 | Authors:
17 | Jinyan Guan, Ernesto Brau
18 |
19 * =========================================================================== */
20 
21 /* $Id: pt_optical_flow_likelihood.h 18178 2014-11-11 18:26:57Z ernesto $ */
22 
23 #ifndef PT_OPTICAL_FLOW_LIKELIHOOD_H
24 #define PT_OPTICAL_FLOW_LIKELIHOOD_H
25 
32 #include <vector>
33 
34 namespace kjb {
35 namespace pt {
36 
44 {
45 public:
48  (
49  const std::vector<Integral_flow>& flows_x,
50  const std::vector<Integral_flow>& flows_y,
51  double img_width,
52  double img_height,
53  double x_scale,
54  double y_scale,
55  double bg_x_scale,
56  double bg_y_scale
57  ) :
58  m_flows_x(flows_x),
59  m_flows_y(flows_y),
60  m_width(img_width),
61  m_height(img_height),
62  m_x_dist(0.0, x_scale),
63  m_y_dist(0.0, y_scale),
64  m_bg_x_dist(0.0, bg_x_scale),
65  m_bg_y_dist(0.0, bg_y_scale)
66  {}
67 
69  double operator()(const Scene& scene) const;
70 
72  double at_trajectory(const Target& target) const;
73 
75  double at_box(const Body_2d& b2d, size_t cur_frame) const;
76 
78  const Laplace_distribution& x_dist() const { return m_x_dist; }
79 
81  const Laplace_distribution& y_dist() const { return m_y_dist; }
82 
84  const Laplace_distribution& bg_x_dist() const { return m_bg_x_dist; }
85 
87  const Laplace_distribution& bg_y_dist() const { return m_bg_y_dist; }
88 
89 private:
90  // data members
91  const std::vector<Integral_flow>& m_flows_x;
92  const std::vector<Integral_flow>& m_flows_y;
93  double m_width;
94  double m_height;
95  Laplace_distribution m_x_dist;
96  Laplace_distribution m_y_dist;
97  Laplace_distribution m_bg_x_dist;
98  Laplace_distribution m_bg_y_dist;
99 };
100 
101 }} // namespace kjb::pt
102 
103 #endif /*PT_OPTICAL_FLOW_LIKELIHOOD_H */
104 
const Laplace_distribution & bg_y_dist() const
Return the individual Laplace distribution for y.
Definition: pt_optical_flow_likelihood.h:87
Definition of various standard probability distributions.
const Laplace_distribution & x_dist() const
Return the individual Laplace distribution for x.
Definition: pt_optical_flow_likelihood.h:78
Class to compute face optical flow likelihood.
Definition: pt_optical_flow_likelihood.h:43
double operator()(const Scene &scene) const
Evaluate this likelihood at the given scene.
Definition: pt_optical_flow_likelihood.cpp:41
Class that represents a full scene in the PT universe.
Definition: pt_scene.h:40
2D body information resulting from projecting the 3D body.
Definition: pt_body_2d.h:35
const Laplace_distribution & bg_x_dist() const
Return the individual Laplace distribution for x.
Definition: pt_optical_flow_likelihood.h:84
double at_box(const Body_2d &b2d, size_t cur_frame) const
Evaluate likelihood at a single box.
Definition: pt_optical_flow_likelihood.cpp:72
boost::math::laplace Laplace_distribution
Definition: prob_distribution.h:67
Class that represents a target moving through space.
Definition: pt_target.h:50
const Laplace_distribution & y_dist() const
Return the individual Laplace distribution for y.
Definition: pt_optical_flow_likelihood.h:81
double at_trajectory(const Target &target) const
Evaluate likelihood at boxes of a trajectory.
Definition: pt_optical_flow_likelihood.cpp:54
Optical_flow_likelihood(const std::vector< Integral_flow > &flows_x, const std::vector< Integral_flow > &flows_y, double img_width, double img_height, double x_scale, double y_scale, double bg_x_scale, double bg_y_scale)
Construct an OF likelihood with the given parameters.
Definition: pt_optical_flow_likelihood.h:48