Point Cloud Library (PCL)  1.7.1
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 
42 #ifndef PCL_FILTERS_FAST_BILATERAL_OMP_H_
43 #define PCL_FILTERS_FAST_BILATERAL_OMP_H_
44 
45 #include <pcl/filters/filter.h>
46 #include <pcl/filters/fast_bilateral.h>
47 
48 namespace pcl
49 {
50  /** \brief Implementation of a fast bilateral filter for smoothing depth information in organized point clouds
51  * Based on the following paper:
52  * * Sylvain Paris and FrŽdo Durand
53  * "A Fast Approximation of the Bilateral Filter using a Signal Processing Approach"
54  * European Conference on Computer Vision (ECCV'06)
55  *
56  * More details on the webpage: http://people.csail.mit.edu/sparis/bf/
57  */
58  template<typename PointT>
60  {
61  protected:
67 
69 
70  public:
71 
72  typedef boost::shared_ptr< FastBilateralFilterOMP<PointT> > Ptr;
73  typedef boost::shared_ptr< const FastBilateralFilterOMP<PointT> > ConstPtr;
74 
75  /** \brief Empty constructor. */
76  FastBilateralFilterOMP (unsigned int nr_threads = 0)
77  : threads_ (nr_threads)
78  { }
79 
80  /** \brief Initialize the scheduler and set the number of threads to use.
81  * \param nr_threads the number of hardware threads to use (0 sets the value back to automatic)
82  */
83  inline void
84  setNumberOfThreads (unsigned int nr_threads = 0) { threads_ = nr_threads; }
85 
86  /** \brief Filter the input data and store the results into output.
87  * \param[out] output the resultant point cloud
88  */
89  void
90  applyFilter (PointCloud &output);
91 
92  protected:
93  /** \brief The number of threads the scheduler should use. */
94  unsigned int threads_;
95 
96  };
97 }
98 
99 #ifdef PCL_NO_PRECOMPILE
100 #include <pcl/filters/impl/fast_bilateral_omp.hpp>
101 #else
102 #define PCL_INSTANTIATE_FastBilateralFilterOMP(T) template class PCL_EXPORTS pcl::FastBilateralFilterOMP<T>;
103 #endif
104 
105 
106 #endif /* PCL_FILTERS_FAST_BILATERAL_OMP_H_ */
107