Point Cloud Library (PCL)  1.14.0-dev
people_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 <iostream>
40 #include <sstream>
41 #include <fstream>
42 
43 #include <pcl/point_types.h>
44 #include <pcl/console/print.h>
45 #include <pcl/gpu/containers/device_array.h>
46 #include <pcl/gpu/people/label_common.h>
47 #include <pcl/gpu/people/tree.h>
48 #include <pcl/gpu/people/person_attribs.h>
49 //#include <opencv2/core/core.hpp>
50 
51 #include <pcl/gpu/people/bodyparts_detector.h>
52 #include <pcl/gpu/people/face_detector.h>
53 #include <pcl/gpu/people/organized_plane_detector.h>
54 #include <pcl/gpu/people/probability_processor.h>
55 
56 namespace pcl
57 {
58  namespace gpu
59  {
60  namespace people
61  {
63  {
64  public:
65  using Ptr = shared_ptr<PeopleDetector>;
66  using ConstPtr = shared_ptr<const PeopleDetector>;
67 
72 
73  // ALL THE DETECTOR OBJECTS
77  //OtherDetector::Ptr other_detector_;
78 
79  // ALL THE OTHER PEOPLE STUFF
82 
83  /** \brief Class constructor. */
85 
86  /** \brief User must set non standard intrinsics */
87  void
88  setIntrinsics (float fx, float fy, float cx = -1, float cy = -1);
89 
90  /** \brief Possible will be removed because of extra overheads */
91  int
93 
94  int
96 
97  int
98  process (const Depth& depth, const Image& rgba);
99 
100  /** \brief Set the tolerance for the delta on the Hue in Seeded Hue Segmentation step */
101  inline void
102  setDeltaHueTolerance (unsigned int delta_hue_tolerance)
103  {
104  delta_hue_tolerance_ = delta_hue_tolerance;
105  }
106 
107  /** \brief Get the tolerance for the delta on the Hue in Seeded Hue Segmentation step, defaults to 5 */
108  inline unsigned int
110  {
111  return (delta_hue_tolerance_);
112  }
113 
114  /** \brief Class getName method. */
115  inline const std::string getClassName () const { return "PeopleDetector"; }
116 
120 
121  /** \brief indicates first time callback (allows for tracking features to start from second frame) **/
123  float fx_, fy_, cx_, cy_;
124  unsigned int delta_hue_tolerance_;
125 
127 
133 
135 
137 
140 
143 
144  int
146 
147  /**
148  * \brief Process the depth based on probabilities supporting tracking, person specific files used
149  **/
150  int
152 
153  void
154  allocate_buffers (int rows = 480, int cols = 640);
155 
156  void
157  shs5 (const pcl::PointCloud<PointT> &cloud, const pcl::Indices& indices, unsigned char *mask);
158 
159  //!!! only for debug purposes TODO: remove this.
160  friend class PeoplePCDApp;
161  };
162  }
163  }
164 }
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: point_cloud.h:173
shared_ptr< const PointCloud< PointT > > ConstPtr
Definition: point_cloud.h:414
shared_ptr< FaceDetector > Ptr
Definition: face_detector.h:61
shared_ptr< OrganizedPlaneDetector > Ptr
bool first_iteration_
indicates first time callback (allows for tracking features to start from second frame)
shared_ptr< const PeopleDetector > ConstPtr
void setDeltaHueTolerance(unsigned int delta_hue_tolerance)
Set the tolerance for the delta on the Hue in Seeded Hue Segmentation step.
OrganizedPlaneDetector::Ptr org_plane_detector_
void shs5(const pcl::PointCloud< PointT > &cloud, const pcl::Indices &indices, unsigned char *mask)
int process(const PointCloud< PointTC >::ConstPtr &cloud)
Possible will be removed because of extra overheads.
const std::string getClassName() const
Class getName method.
shared_ptr< PeopleDetector > Ptr
PersonAttribs::Ptr person_attribs_
RDFBodyPartsDetector::Ptr rdf_detector_
PointCloud< unsigned char > flowermat_host_
DeviceArray< unsigned char > kernelRect5x5_
int processProb(const PointCloud< PointTC >::ConstPtr &cloud)
int process(const Depth &depth, const Image &rgba)
DeviceArray2D< PointT > cloud_device_
PointCloud< unsigned short > depth_host_
unsigned int getDeltaHueTolerance() const
Get the tolerance for the delta on the Hue in Seeded Hue Segmentation step, defaults to 5.
ProbabilityProcessor::Ptr probability_processor_
void allocate_buffers(int rows=480, int cols=640)
int processProb()
Process the depth based on probabilities supporting tracking, person specific files used.
PointCloud< PointTC > cloud_host_color_
void setIntrinsics(float fx, float fy, float cx=-1, float cy=-1)
User must set non standard intrinsics.
PeopleDetector()
Class constructor.
PointCloud< PointT > cloud_host_
shared_ptr< PersonAttribs > Ptr
shared_ptr< ProbabilityProcessor > Ptr
shared_ptr< RDFBodyPartsDetector > Ptr
Defines all the PCL implemented PointT point type structures.
IndicesAllocator<> Indices
Type used for indices in PCL.
Definition: types.h:133
#define PCL_EXPORTS
Definition: pcl_macros.h:323
A point structure representing Euclidean xyz coordinates.
A point structure representing Euclidean xyz coordinates, and the RGBA color.