Point Cloud Library (PCL)  1.14.1-dev
fast_bilateral_omp.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2012-, Open Perception, Inc.
6  * Copyright (c) 2004, Sylvain Paris and Francois Sillion
7 
8  * All rights reserved.
9 
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * * Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  * * Redistributions in binary form must reproduce the above
17  * copyright notice, this list of conditions and the following
18  * disclaimer in the documentation and/or other materials provided
19  * with the distribution.
20  * * Neither the name of the copyright holder(s) nor the names of its
21  * contributors may be used to endorse or promote products derived
22  * from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35  * POSSIBILITY OF SUCH DAMAGE.
36  *
37  * $Id: fast_bilateral_omp.h 8379 2013-01-02 23:12:21Z sdmiller $
38  *
39  */
40 
41 #pragma once
42 
43 #include <pcl/filters/filter.h>
44 #include <pcl/filters/fast_bilateral.h>
45 
46 namespace pcl
47 {
48  /** \brief Implementation of a fast bilateral filter for smoothing depth information in organized point clouds
49  * Based on the following paper:
50  * * Sylvain Paris and Fredo Durand
51  * "A Fast Approximation of the Bilateral Filter using a Signal Processing Approach"
52  * European Conference on Computer Vision (ECCV'06)
53  *
54  * More details on the webpage: http://people.csail.mit.edu/sparis/bf/
55  */
56  template<typename PointT>
58  {
59  protected:
65 
67 
68  public:
69 
70  using Ptr = shared_ptr<FastBilateralFilterOMP<PointT> >;
71  using ConstPtr = shared_ptr<const FastBilateralFilterOMP<PointT> >;
72 
73  /** \brief Empty constructor. */
74  FastBilateralFilterOMP (unsigned int nr_threads = 0)
75  {
76  setNumberOfThreads(nr_threads);
77  }
78 
79  /** \brief Initialize the scheduler and set the number of threads to use.
80  * \param nr_threads the number of hardware threads to use (0 sets the value back to automatic)
81  */
82  void
83  setNumberOfThreads (unsigned int nr_threads = 0);
84 
85  /** \brief Filter the input data and store the results into output.
86  * \param[out] output the resultant point cloud
87  */
88  void
89  applyFilter (PointCloud &output) override;
90 
91  protected:
92  /** \brief The number of threads the scheduler should use. */
93  unsigned int threads_;
94 
95  };
96 }
97 
98 #ifdef PCL_NO_PRECOMPILE
99 #include <pcl/filters/impl/fast_bilateral_omp.hpp>
100 #else
101 #define PCL_INSTANTIATE_FastBilateralFilterOMP(T) template class PCL_EXPORTS pcl::FastBilateralFilterOMP<T>;
102 #endif
Implementation of a fast bilateral filter for smoothing depth information in organized point clouds B...
shared_ptr< FastBilateralFilter< PointT > > Ptr
shared_ptr< const FastBilateralFilter< PointT > > ConstPtr
Implementation of a fast bilateral filter for smoothing depth information in organized point clouds B...
unsigned int threads_
The number of threads the scheduler should use.
void setNumberOfThreads(unsigned int nr_threads=0)
Initialize the scheduler and set the number of threads to use.
void applyFilter(PointCloud &output) override
Filter the input data and store the results into output.
FastBilateralFilterOMP(unsigned int nr_threads=0)
Empty constructor.
typename FastBilateralFilter< PointT >::Array3D Array3D
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: point_cloud.h:173