Point Cloud Library (PCL)  1.14.0-dev
organized_plane_detector.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2011, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage, Inc. nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  * @author: Koen Buys
35  */
36 
37 #pragma once
38 
39 #include <pcl/memory.h>
40 #include <pcl/pcl_exports.h>
41 #include <pcl/point_types.h>
42 #include <pcl/point_cloud.h>
43 
44 #include <pcl/features/integral_image_normal.h>
45 #include <pcl/segmentation/organized_multi_plane_segmentation.h>
46 #include <pcl/common/transforms.h>
47 #include <pcl/gpu/people/label_common.h>
48 
49 #include <string>
50 #include <vector>
51 
52 namespace pcl
53 {
54  namespace gpu
55  {
56  namespace people
57  {
59  {
60  public:
61  using Ptr = shared_ptr<OrganizedPlaneDetector>;
62  using ConstPtr = shared_ptr<const OrganizedPlaneDetector>;
63 
66 
68 
69  //using Labels = DeviceArray2D<unsigned char>;
70  //using Depth = DeviceArray2D<unsigned short>;
71  //using Image = DeviceArray2D<pcl::RGB>;
72 
73  HostLabelProbability P_l_host_; // This is a HOST histogram!
75 
76  pcl::device::LabelProbability P_l_dev_; // This is a DEVICE histogram!
78 
79  protected:
82 
85 
90 
91  public:
92  /** \brief This is the constructor **/
93  OrganizedPlaneDetector (int rows = 480, int cols = 640);
94 
95  /** \brief Process step, this wraps Organized Plane Segmentation code **/
97 
98  double getMpsAngularThreshold () const
99  {
100  return mps_AngularThreshold_;
101  }
102 
103  void setMpsAngularThreshold (double mpsAngularThreshold)
104  {
105  mps_AngularThreshold_ = mpsAngularThreshold;
106  mps_.setAngularThreshold (mps_AngularThreshold_);
107  }
108 
109  double getMpsDistanceThreshold () const
110  {
111  return mps_DistanceThreshold_;
112  }
113 
114  void setMpsDistanceThreshold (double mpsDistanceThreshold)
115  {
116  mps_DistanceThreshold_ = mpsDistanceThreshold;
117  mps_.setDistanceThreshold (mps_DistanceThreshold_);
118  }
119 
120  int getMpsMinInliers () const
121  {
122  return mps_MinInliers_;
123  }
124 
125  void setMpsMinInliers (int mpsMinInliers)
126  {
127  mps_MinInliers_ = mpsMinInliers;
128  mps_.setMinInliers (mps_MinInliers_);
129 
130 
131  }
132 
134  {
136  }
137 
138  void setNeMaxDepthChangeFactor (float neMaxDepthChangeFactor)
139  {
140  ne_MaxDepthChangeFactor_ = neMaxDepthChangeFactor;
141  ne_.setMaxDepthChangeFactor (ne_MaxDepthChangeFactor_);
142  }
143 
145  {
147  }
148 
149  void setNeNormalSmoothingSize (float neNormalSmoothingSize)
150  {
151  ne_NormalSmoothingSize_ = neNormalSmoothingSize;
152  ne_.setNormalSmoothingSize (ne_NormalSmoothingSize_);
153  }
154 
155  void
157 
158  int
160  HostLabelProbability& dst);
161 
162  int
164  HostLabelProbability& dst);
165 
166  private:
167  void allocate_buffers(int rows = 480, int cols = 640);
168 
169  };
170  }
171  }
172 }
Surface normal estimation on organized data using integral images.
OrganizedMultiPlaneSegmentation finds all planes present in the input cloud, and outputs a vector of ...
shared_ptr< const PointCloud< PointT > > ConstPtr
Definition: point_cloud.h:414
DeviceArray2D class
Definition: device_array.h:188
void setMpsDistanceThreshold(double mpsDistanceThreshold)
void setNeMaxDepthChangeFactor(float neMaxDepthChangeFactor)
shared_ptr< const OrganizedPlaneDetector > ConstPtr
void emptyHostLabelProbability(HostLabelProbability &histogram)
void setNeNormalSmoothingSize(float neNormalSmoothingSize)
int copyAndClearHostLabelProbability(HostLabelProbability &src, HostLabelProbability &dst)
shared_ptr< OrganizedPlaneDetector > Ptr
void setMpsAngularThreshold(double mpsAngularThreshold)
OrganizedPlaneDetector(int rows=480, int cols=640)
This is the constructor.
void process(const PointCloud< PointTC >::ConstPtr &cloud)
Process step, this wraps Organized Plane Segmentation code.
pcl::OrganizedMultiPlaneSegmentation< PointTC, pcl::Normal, pcl::Label > mps_
pcl::IntegralImageNormalEstimation< PointTC, pcl::Normal > ne_
int copyHostLabelProbability(HostLabelProbability &src, HostLabelProbability &dst)
Defines all the PCL implemented PointT point type structures.
Defines functions, macros and traits for allocating and using memory.
A point structure representing Euclidean xyz coordinates.
A point structure representing Euclidean xyz coordinates, and the RGBA color.