GainCompensator.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the Universite de Sherbrooke nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef CORELIB_SRC_GAINCOMPENSATOR_H_
29 #define CORELIB_SRC_GAINCOMPENSATOR_H_
30 
31 #include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
32 
33 #include <pcl/point_cloud.h>
34 #include <pcl/point_types.h>
35 #include <pcl/pcl_base.h>
36 #include <opencv2/opencv.hpp>
37 #include <rtabmap/core/Link.h>
38 
39 namespace rtabmap {
40 
44 class RTABMAP_CORE_EXPORT GainCompensator {
45 public:
46  GainCompensator(double maxCorrespondenceDistance = 0.02, double minOverlap = 0.0, double alpha = 0.01, double beta = 10);
47  virtual ~GainCompensator();
48 
49  void feed(
50  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloudA, // should not contain NaNs
51  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloudB, // should not contain NaNs
52  const Transform & transformB);
53  void feed(
54  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloudA,
55  const pcl::IndicesPtr & indicesA,
56  const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloudB,
57  const pcl::IndicesPtr & indicesB,
58  const Transform & transformB);
59  void feed(
60  const std::map<int, pcl::PointCloud<pcl::PointXYZRGB>::Ptr> & clouds, // should not contain NaNs
61  const std::multimap<int, Link> & links);
62  void feed(
63  const std::map<int, pcl::PointCloud<pcl::PointXYZRGB>::Ptr> & clouds,
64  const std::map<int, pcl::IndicesPtr> & indices,
65  const std::multimap<int, Link> & links);
66  void feed(
67  const std::map<int, pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr> & clouds,
68  const std::map<int, pcl::IndicesPtr> & indices,
69  const std::multimap<int, Link> & links);
70  void feed(
71  const std::map<int, std::pair<pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr, pcl::IndicesPtr> > & clouds,
72  const std::multimap<int, Link> & links);
73 
74  void apply(
75  int id,
76  pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
77  bool rgb = true) const;
78  void apply(
79  int id,
80  pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
81  const pcl::IndicesPtr & indices,
82  bool rgb = true) const;
83  void apply(
84  int id,
85  pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
86  const pcl::IndicesPtr & indices,
87  bool rgb = true) const;
88  void apply(
89  int id,
90  cv::Mat & image,
91  bool rgb = true) const;
92 
93  double getGain(int id, double * r=0, double * g=0, double * b=0) const;
94  int getIndex(int id) const;
95 
96 private:
97  cv::Mat_<double> gains_;
98  std::map<int, int> idToIndex_;
100  double minOverlap_;
101  double alpha_;
102  double beta_;
103 
104 };
105 
106 } /* namespace rtabmap */
107 
108 #endif /* CORELIB_SRC_GAINCOMPENSATOR_H_ */
alpha
RealScalar alpha
b
Array< int, 3, 1 > b
rtabmap::GainCompensator::maxCorrespondenceDistance_
double maxCorrespondenceDistance_
Definition: GainCompensator.h:99
rtabmap::GainCompensator::idToIndex_
std::map< int, int > idToIndex_
Definition: GainCompensator.h:98
rtabmap::GainCompensator::beta_
double beta_
Definition: GainCompensator.h:102
beta
double beta(double a, double b)
indices
indices
g
float g
rtabmap::GainCompensator
Definition: GainCompensator.h:44
rtabmap::GainCompensator::minOverlap_
double minOverlap_
Definition: GainCompensator.h:100
apply
DecisionTree< L, Y > apply(const DecisionTree< L, Y > &f, const DecisionTree< L, Y > &g, const typename DecisionTree< L, Y >::Binary &op)
rtabmap::Transform
Definition: Transform.h:41
rtabmap::GainCompensator::gains_
cv::Mat_< double > gains_
Definition: GainCompensator.h:97
rtabmap
Definition: CameraARCore.cpp:35
rtabmap::GainCompensator::alpha_
double alpha_
Definition: GainCompensator.h:101


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:10