Point Cloud Library (PCL)  1.14.1-dev
probability_processor.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/point_types.h>
40 #include <pcl/console/print.h>
41 #include <pcl/gpu/containers/device_array.h>
42 #include <pcl/gpu/people/label_common.h>
43 
44 #include <fstream>
45 #include <iostream>
46 #include <memory>
47 #include <sstream>
48 
49 namespace pcl
50 {
51  namespace device
52  {
53  class ProbabilityProc;
54  }
55 
56  namespace gpu
57  {
58  namespace people
59  {
61  {
62  public:
63  using Ptr = shared_ptr<ProbabilityProcessor>;
64  using ConstPtr = shared_ptr<const ProbabilityProcessor>;
67 
69 
70  /** \brief This will merge the votes from the different trees into one final vote, including probabilistic's **/
71  void
72  SelectLabel (const Depth& depth, Labels& labels, pcl::device::LabelProbability& probabilities);
73 
74  /** \brief This will combine two probabilities according their weight **/
75  void
76  CombineProb ( const Depth& depth,
78  float weight1,
80  float weight2,
82 
83  /** \brief This will sum a probability multiplied with it's weight **/
84  void
85  WeightedSumProb ( const Depth& depth, pcl::device::LabelProbability& probIn, float weight, pcl::device::LabelProbability& probOut);
86 
87  /** \brief This will create a Gaussian Kernel **/
88  float*
89  CreateGaussianKernel ( float sigma,
90  int kernelSize);
91 
92  /** \brief This will do a GaussianBlur over the LabelProbability **/
93  int
94  GaussianBlur( const Depth& depth,
98 
99  /** \brief This will do a GaussianBlur over the LabelProbability **/
100  int
101  GaussianBlur( const Depth& depth,
106 
107  private:
108  std::shared_ptr<pcl::device::ProbabilityProc> impl_;
109 
110  };
111  }
112  }
113 }
shared_ptr< const ProbabilityProcessor > ConstPtr
int GaussianBlur(const Depth &depth, pcl::device::LabelProbability &probIn, DeviceArray< float > &kernel, pcl::device::LabelProbability &probTemp, pcl::device::LabelProbability &probOut)
This will do a GaussianBlur over the LabelProbability.
void SelectLabel(const Depth &depth, Labels &labels, pcl::device::LabelProbability &probabilities)
This will merge the votes from the different trees into one final vote, including probabilistic's.
float * CreateGaussianKernel(float sigma, int kernelSize)
This will create a Gaussian Kernel.
int GaussianBlur(const Depth &depth, pcl::device::LabelProbability &probIn, DeviceArray< float > &kernel, pcl::device::LabelProbability &probOut)
This will do a GaussianBlur over the LabelProbability.
void CombineProb(const Depth &depth, pcl::device::LabelProbability &probIn1, float weight1, pcl::device::LabelProbability &probIn2, float weight2, pcl::device::LabelProbability &probOut)
This will combine two probabilities according their weight.
void WeightedSumProb(const Depth &depth, pcl::device::LabelProbability &probIn, float weight, pcl::device::LabelProbability &probOut)
This will sum a probability multiplied with it's weight.
shared_ptr< ProbabilityProcessor > Ptr
Defines all the PCL implemented PointT point type structures.
#define PCL_EXPORTS
Definition: pcl_macros.h:323