Point Cloud Library (PCL)  1.8.1
range_image_visualizer.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2010, 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  *
35  */
36 
37 #include <pcl/pcl_config.h>
38 
39 #ifndef PCL_VISUALIZATION_RANGE_IMAGE_VISUALIZER_H_
40 #define PCL_VISUALIZATION_RANGE_IMAGE_VISUALIZER_H_
41 
42 // PCL includes
43 #include <pcl/range_image/range_image.h>
44 #include <pcl/visualization/image_viewer.h>
45 
46 namespace pcl
47 {
48  namespace visualization
49  {
50  /** \brief Range image visualizer class.
51  * \author Bastian Steder
52  * \ingroup visualization
53  */
54  class PCL_EXPORTS RangeImageVisualizer : public ImageViewer
55  {
56  public:
57  // =====CONSTRUCTOR & DESTRUCTOR=====
58  //! Constructor
59  RangeImageVisualizer (const std::string& name="Range Image");
60  //! Destructor
62 
63  // =====PUBLIC STATIC METHODS=====
64  /** Get a widget visualizing the given range image.
65  * You are responsible for deleting it after usage! */
66  static RangeImageVisualizer* getRangeImageWidget (const pcl::RangeImage& range_image, float min_value,
67  float max_value, bool grayscale, const std::string& name="Range image");
68 
69  /** Visualize the given range image and the detected borders in it.
70  * Borders on the obstacles are marked green, borders on the background are marked bright blue. */
71  void visualizeBorders (const pcl::RangeImage& range_image, float min_value, float max_value, bool grayscale,
72  const pcl::PointCloud<pcl::BorderDescription>& border_descriptions);
73 
74  /** Same as above, but returning a new widget. You are responsible for deleting it after usage! */
75  static RangeImageVisualizer* getRangeImageBordersWidget (const pcl::RangeImage& range_image, float min_value,
76  float max_value, bool grayscale, const pcl::PointCloud<pcl::BorderDescription>& border_descriptions,
77  const std::string& name="Range image with borders");
78 
79  /** Get a widget visualizing the given angle image (assuming values in (-PI, PI]).
80  * -PI and PI will return the same color
81  * You are responsible for deleting it after usage! */
82  static RangeImageVisualizer* getAnglesWidget (const pcl::RangeImage& range_image, float* angles_image, const std::string& name);
83 
84  /** Get a widget visualizing the given angle image (assuming values in (-PI/2, PI/2]).
85  * -PI/2 and PI/2 will return the same color
86  * You are responsible for deleting it after usage! */
87  static RangeImageVisualizer* getHalfAnglesWidget (const pcl::RangeImage& range_image, float* angles_image, const std::string& name);
88 
89 
90  /** Get a widget visualizing the interest values and extracted interest points.
91  * The interest points will be marked green.
92  * You are responsible for deleting it after usage! */
93  static RangeImageVisualizer* getInterestPointsWidget (const pcl::RangeImage& range_image, const float* interest_image, float min_value, float max_value,
94  const pcl::PointCloud<pcl::InterestPoint>& interest_points, const std::string& name);
95 
96  // =====PUBLIC METHODS=====
97  //! Visualize a range image
98  /* void */
99  /* setRangeImage (const pcl::RangeImage& range_image, */
100  /* float min_value = -std::numeric_limits<float>::infinity (), */
101  /* float max_value = std::numeric_limits<float>::infinity (), */
102  /* bool grayscale = false); */
103 
104  void
105  showRangeImage (const pcl::RangeImage& range_image,
106  float min_value = -std::numeric_limits<float>::infinity (),
107  float max_value = std::numeric_limits<float>::infinity (),
108  bool grayscale = false);
109 
110  protected:
111  // =====PROTECTED MEMBER VARIABLES=====
112  std::string name_;
113  };
114  }
115 }
116 
117 #endif //#define PCL_VISUALIZATION_RANGE_IMAGE_VISUALIZER_H_
RangeImage is derived from pcl/PointCloud and provides functionalities with focus on situations where...
Definition: range_image.h:55
ImageViewer is a class for 2D image visualization.
Definition: image_viewer.h:118
PointCloud represents the base class in PCL for storing collections of 3D points.