2 //////////////////////////////////////////////////////////////////////////////////
3 // This program is free software: you can redistribute it and/or modify //
4 // it under the terms of the version 3 of the GNU General Public License //
5 // as published by the Free Software Foundation. //
7 // This program is distributed in the hope that it will be useful, but //
8 // WITHOUT ANY WARRANTY; without even the implied warranty of //
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //
10 // General Public License for more details. //
12 // You should have received a copy of the GNU General Public License //
13 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
15 // Written by Francois Fleuret //
16 // (C) Ecole Polytechnique Federale de Lausanne //
17 // Contact <pom@epfl.ch> for comments & bug reports //
18 //////////////////////////////////////////////////////////////////////////////////
24 #include "integral_proba_view.h"
25 #include "normal_law.h"
30 // At each pixel the proba for the pixel to be off
34 // At each pixel, 0 if the view is 0, and the proba for the pixel to
35 // be off if the view is 1 (or, more mathematically: neg * view)
39 // Integral images to speed-up computation
41 IntegralProbaView ii_neg, ii_neg_view;
43 // Distribution of surface_difference / surface_synthetic
45 NormalLaw global_difference;
47 void compute_average_images(int camera,
49 Vector<scalar_t> *proba_absence);
51 // Adds to every sum[i] the value log(P(X_i = 1 | V_camera) / P(X_i
52 // = 0 | V_camera)), given the other P(X_j = 1 | V)
54 void add_log_ratio(int camera,
57 Vector<scalar_t> *proba_absence,
58 Vector<scalar_t> *sum);
62 POMSolver(Room *room);
64 // Uses the computation above for the various cameras and the prior
65 // to refresh proba_absence. Iterates as many times as specified.
67 void solve(Room *room,
68 Vector<scalar_t> *prior,
69 Vector<ProbaView *> *views,
70 Vector<scalar_t> *proba_presence,
72 char *convergence_file_format);