RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
frame_projector.h
1/*
2Copyright (c) 2013, Alex Teichman and Stephen Miller (Stanford University)
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, 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 <organization> 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
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
20DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23ON 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
25SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27RTAB-Map integration: Mathieu Labbe
28*/
29
30#ifndef FRAME_PROJECTOR_H
31#define FRAME_PROJECTOR_H
32
33#include <pcl/point_cloud.h>
34#include <pcl/point_types.h>
35#include <opencv2/core/core.hpp>
36#include <rtabmap/core/CameraModel.h>
37
38#define MAX_MULT 1.3
39#define MIN_MULT 0.7
40
41namespace clams
42{
43
48 {
49 public:
51 u_(0),
52 v_(0),
53 z_(0.0f) {}
54
55 int u_;
56 int v_;
57 float z_; // in meters
58 };
59
62 class RTABMAP_CORE_EXPORT FrameProjector
63 {
64 public:
65 // For storing z values in meters. This is not Euclidean distance.
66 typedef std::vector< std::vector< std::vector<double> > > RangeIndex;
67
69
70 RangeIndex cloudToRangeIndex(const pcl::PointCloud<pcl::PointXYZ>::Ptr & pcd) const;
75 const pcl::PointCloud<pcl::PointXYZ>::Ptr & map,
76 const rtabmap::Transform & transform,
77 const cv::Mat & measurement,
78 double coneRadius = 0.02,
79 double coneStdevThresh = 0.03) const;
80
81 pcl::PointXYZ project(const ProjectivePoint& ppt) const;
82 ProjectivePoint reproject(const pcl::PointXYZ& pt) const;
83
84 protected:
85 bool coneFit(const cv::Size& imageSize, const RangeIndex& rindex,
86 int uc, int vc, double radius, double measurement_depth,
87 double* mean, double* stdev) const;
88
89 private:
91 };
92
93} // namespace clams
94
95#endif // FRAME_PROJECTOR_H
cv::Mat estimateMapDepth(const pcl::PointCloud< pcl::PointXYZ >::Ptr &map, const rtabmap::Transform &transform, const cv::Mat &measurement, double coneRadius=0.02, double coneStdevThresh=0.03) const
Represents a pinhole camera model containing intrinsic and extrinsic parameters, used for projection,...
Definition CameraModel.h:53
Represents a 3D rigid body transformation (rotation + translation).
Definition Transform.h:53