GainCompensator.h
Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
00003 All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without
00006 modification, are permitted provided that the following conditions are met:
00007     * Redistributions of source code must retain the above copyright
00008       notice, this list of conditions and the following disclaimer.
00009     * Redistributions in binary form must reproduce the above copyright
00010       notice, this list of conditions and the following disclaimer in the
00011       documentation and/or other materials provided with the distribution.
00012     * Neither the name of the Universite de Sherbrooke nor the
00013       names of its contributors may be used to endorse or promote products
00014       derived from this software without specific prior written permission.
00015 
00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00017 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00018 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00019 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
00020 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00021 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00022 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00023 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00024 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00025 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026 */
00027 
00028 #ifndef CORELIB_SRC_GAINCOMPENSATOR_H_
00029 #define CORELIB_SRC_GAINCOMPENSATOR_H_
00030 
00031 #include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
00032 
00033 #include <pcl/point_cloud.h>
00034 #include <pcl/point_types.h>
00035 #include <pcl/pcl_base.h>
00036 #include <opencv2/opencv.hpp>
00037 #include <rtabmap/core/Link.h>
00038 
00039 namespace rtabmap {
00040 
00044 class RTABMAP_EXP GainCompensator {
00045 public:
00046         GainCompensator(double maxCorrespondenceDistance = 0.02, double minOverlap = 0.0, double alpha = 0.01, double beta = 10);
00047         virtual ~GainCompensator();
00048 
00049         void feed(
00050                         const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloudA, // should not contain NaNs
00051                         const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloudB, // should not contain NaNs
00052                         const Transform & transformB);
00053         void feed(
00054                         const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloudA,
00055                         const pcl::IndicesPtr & indicesA,
00056                         const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloudB,
00057                         const pcl::IndicesPtr & indicesB,
00058                         const Transform & transformB);
00059         void feed(
00060                         const std::map<int, pcl::PointCloud<pcl::PointXYZRGB>::Ptr> & clouds, // should not contain NaNs
00061                         const std::multimap<int, Link> & links);
00062         void feed(
00063                         const std::map<int, pcl::PointCloud<pcl::PointXYZRGB>::Ptr> & clouds,
00064                         const std::map<int, pcl::IndicesPtr> & indices,
00065                         const std::multimap<int, Link> & links);
00066         void feed(
00067                         const std::map<int, pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr> & clouds,
00068                         const std::map<int, pcl::IndicesPtr> & indices,
00069                         const std::multimap<int, Link> & links);
00070         void feed(
00071                         const std::map<int, std::pair<pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr, pcl::IndicesPtr> > & clouds,
00072                         const std::multimap<int, Link> & links);
00073 
00074         void apply(
00075                         int id,
00076                         pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
00077                         bool rgb = true) const;
00078         void apply(
00079                         int id,
00080                         pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
00081                         const pcl::IndicesPtr & indices,
00082                         bool rgb = true) const;
00083         void apply(
00084                         int id,
00085                         pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
00086                         const pcl::IndicesPtr & indices,
00087                         bool rgb = true) const;
00088         void apply(
00089                         int id,
00090                         cv::Mat & image,
00091                         bool rgb = true) const;
00092 
00093         double getGain(int id, double * r=0, double * g=0, double * b=0) const;
00094         int getIndex(int id) const;
00095 
00096 private:
00097         cv::Mat_<double> gains_;
00098         std::map<int, int> idToIndex_;
00099         double maxCorrespondenceDistance_;
00100         double minOverlap_;
00101         double alpha_;
00102         double beta_;
00103 
00104 };
00105 
00106 } /* namespace rtabmap */
00107 
00108 #endif /* CORELIB_SRC_GAINCOMPENSATOR_H_ */


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jun 6 2019 21:59:20