mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-01 17:10:26 +08:00
Added GainCompensator class. GUI/3D Rendering: added texturing option.
This commit is contained in:
104
corelib/include/rtabmap/core/GainCompensator.h
Normal file
104
corelib/include/rtabmap/core/GainCompensator.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the Universite de Sherbrooke nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef CORELIB_SRC_GAINCOMPENSATOR_H_
|
||||
#define CORELIB_SRC_GAINCOMPENSATOR_H_
|
||||
|
||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
||||
|
||||
#include <pcl/point_cloud.h>
|
||||
#include <pcl/point_types.h>
|
||||
#include <pcl/pcl_base.h>
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include <rtabmap/core/Link.h>
|
||||
|
||||
namespace rtabmap {
|
||||
|
||||
/**
|
||||
* Works like cv::GainCompensator but with point clouds
|
||||
*/
|
||||
class RTABMAP_EXP GainCompensator {
|
||||
public:
|
||||
GainCompensator(double maxCorrespondenceDistance = 0.02, double minOverlap = 0.05, double alpha = 0.01, double beta = 10);
|
||||
virtual ~GainCompensator();
|
||||
|
||||
void feed(
|
||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloudA, // should not contain NaNs
|
||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloudB, // should not contain NaNs
|
||||
const Transform & transformB);
|
||||
void feed(
|
||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloudA,
|
||||
const pcl::IndicesPtr & indicesA,
|
||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloudB,
|
||||
const pcl::IndicesPtr & indicesB,
|
||||
const Transform & transformB);
|
||||
void feed(
|
||||
const std::map<int, pcl::PointCloud<pcl::PointXYZRGB>::Ptr> & clouds, // should not contain NaNs
|
||||
const std::multimap<int, Link> & links);
|
||||
void feed(
|
||||
const std::map<int, pcl::PointCloud<pcl::PointXYZRGB>::Ptr> & clouds,
|
||||
const std::map<int, pcl::IndicesPtr> & indices,
|
||||
const std::multimap<int, Link> & links);
|
||||
void feed(
|
||||
const std::map<int, pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr> & clouds,
|
||||
const std::map<int, pcl::IndicesPtr> & indices,
|
||||
const std::multimap<int, Link> & links);
|
||||
void feed(
|
||||
const std::map<int, std::pair<pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr, pcl::IndicesPtr> > & clouds,
|
||||
const std::multimap<int, Link> & links);
|
||||
|
||||
void apply(
|
||||
int id,
|
||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud);
|
||||
void apply(
|
||||
int id,
|
||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||
const pcl::IndicesPtr & indices);
|
||||
void apply(
|
||||
int id,
|
||||
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
||||
const pcl::IndicesPtr & indices);
|
||||
void apply(
|
||||
int id,
|
||||
cv::Mat & image);
|
||||
|
||||
double getGain(int id) const;
|
||||
int getIndex(int id) const;
|
||||
|
||||
private:
|
||||
cv::Mat_<double> gains_;
|
||||
std::map<int, int> idToIndex_;
|
||||
double maxCorrespondenceDistance_;
|
||||
double minOverlap_;
|
||||
double alpha_;
|
||||
double beta_;
|
||||
|
||||
};
|
||||
|
||||
} /* namespace rtabmap */
|
||||
|
||||
#endif /* CORELIB_SRC_GAINCOMPENSATOR_H_ */
|
||||
@@ -14,7 +14,7 @@ namespace util3d {
|
||||
|
||||
template<typename pointT>
|
||||
std::vector<pcl::Vertices> normalizePolygonsSide(
|
||||
const pcl::PointCloud<pointT> & cloud,
|
||||
const typename pcl::PointCloud<pointT> & cloud,
|
||||
const std::vector<pcl::Vertices> & polygons,
|
||||
const pcl::PointXYZ & viewPoint)
|
||||
{
|
||||
|
||||
@@ -433,13 +433,6 @@ pcl::IndicesPtr RTABMAP_EXP normalFiltering(
|
||||
int normalKSearch,
|
||||
const Eigen::Vector4f & viewpoint);
|
||||
|
||||
void RTABMAP_EXP colorMeanFiltering(
|
||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||
const pcl::IndicesPtr & indices,
|
||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloudRef,
|
||||
const pcl::IndicesPtr & indicesRef,
|
||||
float radiusSearch);
|
||||
|
||||
/**
|
||||
* For convenience.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user