frame_projector.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2013, Alex Teichman and Stephen Miller (Stanford University)
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 <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 
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 <COPYRIGHT HOLDER> 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 RTAB-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>
37 #include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
38 
39 #define MAX_MULT 1.3
40 #define MIN_MULT 0.7
41 
42 namespace clams
43 {
44 
49  {
50  public:
52  u_(0),
53  v_(0),
54  z_(0.0f) {}
55 
56  int u_;
57  int v_;
58  float z_; // in meters
59  };
60 
64  {
65  public:
66  // For storing z values in meters. This is not Euclidean distance.
67  typedef std::vector< std::vector< std::vector<double> > > RangeIndex;
68 
69  FrameProjector(const rtabmap::CameraModel & model);
70 
71  RangeIndex cloudToRangeIndex(const pcl::PointCloud<pcl::PointXYZ>::Ptr & pcd) const;
75  cv::Mat estimateMapDepth(
76  const pcl::PointCloud<pcl::PointXYZ>::Ptr & map,
77  const rtabmap::Transform & transform,
78  const cv::Mat & measurement,
79  double coneRadius = 0.02,
80  double coneStdevThresh = 0.03) const;
81 
82  pcl::PointXYZ project(const ProjectivePoint& ppt) const;
83  ProjectivePoint reproject(const pcl::PointXYZ& pt) const;
84 
85  protected:
86  bool coneFit(const cv::Size& imageSize, const RangeIndex& rindex,
87  int uc, int vc, double radius, double measurement_depth,
88  double* mean, double* stdev) const;
89 
90  private:
92  };
93 
94 } // namespace clams
95 
96 #endif // FRAME_PROJECTOR_H
f
double stdev(const Eigen::VectorXd &vec)
#define RTABMAP_EXP
Definition: RtabmapExp.h:38
GLM_FUNC_DECL detail::tvec3< T, P > project(detail::tvec3< T, P > const &obj, detail::tmat4x4< T, P > const &model, detail::tmat4x4< T, P > const &proj, detail::tvec4< U, P > const &viewport)
rtabmap::CameraModel model_
std::vector< std::vector< std::vector< double > > > RangeIndex


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Dec 14 2020 03:34:58