Point Cloud Library (PCL)
1.11.1-dev
people
include
pcl
gpu
people
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
{
60
class
PCL_EXPORTS
ProbabilityProcessor
61
{
62
public
:
63
using
Ptr
= shared_ptr<ProbabilityProcessor>;
64
using
ConstPtr
= shared_ptr<const ProbabilityProcessor>;
65
using
Depth
=
DeviceArray2D<unsigned short>
;
66
using
Labels
=
DeviceArray2D<unsigned char>
;
67
68
ProbabilityProcessor
();
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,
77
pcl::device::LabelProbability
& probIn1,
78
float
weight1,
79
pcl::device::LabelProbability
& probIn2,
80
float
weight2,
81
pcl::device::LabelProbability
& probOut);
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,
95
pcl::device::LabelProbability
& probIn,
96
DeviceArray<float>
&
kernel
,
97
pcl::device::LabelProbability
& probOut);
98
99
/** \brief This will do a GaussianBlur over the LabelProbability **/
100
int
101
GaussianBlur(
const
Depth
& depth,
102
pcl::device::LabelProbability
& probIn,
103
DeviceArray<float>
&
kernel
,
104
pcl::device::LabelProbability
& probTemp,
105
pcl::device::LabelProbability
& probOut);
106
107
private
:
108
std::shared_ptr<pcl::device::ProbabilityProc> impl_;
109
110
};
111
}
112
}
113
}
pcl
Definition:
convolution.h:46
point_types.h
pcl::gpu::DeviceArray2D< unsigned short >
pcl::gpu::people::ProbabilityProcessor::Ptr
shared_ptr< ProbabilityProcessor > Ptr
Definition:
probability_processor.h:63
pcl::gpu::people::ProbabilityProcessor::ConstPtr
shared_ptr< const ProbabilityProcessor > ConstPtr
Definition:
probability_processor.h:64
pcl::gpu::people::ProbabilityProcessor
Definition:
probability_processor.h:60
pcl::gpu::DeviceArray< float >
pcl::kernel
Definition:
kernel.h:46
PCL_EXPORTS
#define PCL_EXPORTS
Definition:
pcl_macros.h:323