Optimized Belief Propagation (CPU and GPU)
DisparityMapEvaluation.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2024 Scott Grauer-Gray
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18 
27 #ifndef DISPARITY_MAP_EVALUATION_H_
28 #define DISPARITY_MAP_EVALUATION_H_
29 
30 #include <map>
31 #include <iostream>
32 #include <numeric>
33 #include <array>
34 #include <vector>
35 #include "RunEval/RunData.h"
36 
37 namespace beliefprop {
38 
40 constexpr std::string_view kAvgRMSErrorHeader{"Average RMS error"};
41 
45 constexpr std::array<float, 4> kDisparityDiffThresholds{
46  0.001, 2.01, 5.01, 10.01};
47 
51 constexpr float kMaxDiffCap{
53 
60  const std::vector<float> output_diff_thresholds{
64 };
65 
66 };
67 
75 public:
82  const beliefprop::DisparityMapEvaluationParams& eval_params);
83 
89  RunData AsRunData() const;
90 
94  std::array<float, 2> average_disp_abs_diff_no_max_w_max_{0, 0};
95  float disparity_error_max_{std::numeric_limits<float>::max()};
96 
100  std::map<float, float> prop_sig_diff_pixels_at_thresholds_;
101 
105  std::map<float, unsigned int> num_sig_diff_pixels_at_thresholds_;
106 };
107 
108 #endif /* DISPARITY_MAP_EVALUATION_H_ */
Declares class to store headers with data corresponding to current program run and evaluation.
Class to store disparity map evaluation results. Specifically comparison between two disparity maps s...
std::array< float, 2 > average_disp_abs_diff_no_max_w_max_
Total and average value of the absolute difference between the disparity values for all pixels in dis...
std::map< float, unsigned int > num_sig_diff_pixels_at_thresholds_
Stores the number of pixels where the difference between the disparity values in disparity images 1 a...
void InitializeWithEvalParams(const beliefprop::DisparityMapEvaluationParams &eval_params)
Initialize evaluation results with evaluation parameters.
RunData AsRunData() const
Retrieve evaluation results as RunData.
std::map< float, float > prop_sig_diff_pixels_at_thresholds_
Proportion of pixels where the difference between the disparity values in disparity images 1 and 2 is...
Class to store headers with data corresponding to current program run and evaluation.
Definition: RunData.h:42
Namespace for enums, constants, structures, and functions specific to belief propagation processing.
constexpr float kMaxDiffCap
Max difference in disparity for evaluation where disparity difference for each pixel is capped to min...
constexpr std::array< float, 4 > kDisparityDiffThresholds
Difference thresholds in output disparity for a computed disparity at a pixel to be considered a "bad...
constexpr std::string_view kAvgRMSErrorHeader
Constant string view for header of average RMS error in evaluation.
Struct to store parameters for evaluation of disparity map from stereo processing.
const std::vector< float > output_diff_thresholds
Difference thresholds for comparing disparity maps.