Point Cloud Library (PCL)  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bilateral_upsampling.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2009-2012, Willow Garage, Inc.
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of Willow Garage, Inc. nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  * $Id: bilateral_upsampling.h 5462 2012-04-01 16:11:40Z aichim $
37  *
38  */
39 
40 
41 #ifndef PCL_SURFACE_BILATERAL_UPSAMPLING_H_
42 #define PCL_SURFACE_BILATERAL_UPSAMPLING_H_
43 
44 #include <pcl/surface/processing.h>
45 
46 namespace pcl
47 {
48 
62  template <typename PointInT, typename PointOutT>
63  class BilateralUpsampling: public CloudSurfaceProcessing<PointInT, PointOutT>
64  {
65  public:
71 
73 
75 
80  , window_size_ (5)
81  , sigma_color_ (15.0f)
82  , sigma_depth_ (0.5f)
83  , projection_matrix_ ()
84  , unprojection_matrix_ ()
85  {
86  KinectVGAProjectionMatrix << 525.0f, 0.0f, 320.0f,
87  0.0f, 525.0f, 240.0f,
88  0.0f, 0.0f, 1.0f;
89  KinectSXGAProjectionMatrix << 1050.0f, 0.0f, 640.0f,
90  0.0f, 1050.0f, 480.0f,
91  0.0f, 0.0f, 1.0f;
92  };
93 
97  inline void
98  setWindowSize (int window_size) { window_size_ = window_size; }
99 
101  inline int
102  getWindowSize () const { return (window_size_); }
103 
107  inline void
108  setSigmaColor (const float &sigma_color) { sigma_color_ = sigma_color; }
109 
111  inline float
112  getSigmaColor () const { return (sigma_color_); }
113 
117  inline void
118  setSigmaDepth (const float &sigma_depth) { sigma_depth_ = sigma_depth; }
119 
121  inline float
122  getSigmaDepth () const { return (sigma_depth_); }
123 
129  inline void
130  setProjectionMatrix (const Eigen::Matrix3f &projection_matrix) { projection_matrix_ = projection_matrix; }
131 
133  inline Eigen::Matrix3f
134  getProjectionMatrix () const { return (projection_matrix_); }
135 
138  void
140 
141  protected:
142  void
143  performProcessing (pcl::PointCloud<PointOutT> &output);
144 
145  private:
146  int window_size_;
147  float sigma_color_, sigma_depth_;
148  Eigen::Matrix3f projection_matrix_, unprojection_matrix_;
149 
150  public:
151  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
152  };
153 }
154 
155 #endif /* PCL_SURFACE_BILATERAL_UPSAMPLING_H_ */