Point Cloud Library (PCL)
1.10.1
pcl
stereo
digital_elevation_map.h
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Point Cloud Library (PCL) - www.pointclouds.org
5
* Copyright (c) 2014-, Open Perception, 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 the copyright holder(s) 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
37
#pragma once
38
39
#include <
pcl/point_types.h
>
40
#include <pcl/stereo/disparity_map_converter.h>
41
42
namespace
pcl
{
43
44
/** \brief Build a Digital Elevation Map in the column-disparity space from a disparity
45
* map and a color image of the scene.
46
*
47
* Example of usage:
48
*
49
* \code
50
* pcl::PointCloud<pcl::PointDEM>::Ptr cloud (new
51
* pcl::PointCloud<pcl::PointDEM>);
52
* pcl::PointCloud<pcl::RGB>::Ptr left_image (new
53
* pcl::PointCloud<pcl::RGB>);
54
* // Fill left image cloud.
55
*
56
* pcl::DigitalElevationMapBuilder demb;
57
* demb.setBaseline (0.8387445f);
58
* demb.setFocalLength (368.534700f);
59
* demb.setImageCenterX (318.112200f);
60
* demb.setImageCenterY (224.334900f);
61
* demb.setDisparityThresholdMin (15.0f);
62
* demb.setDisparityThresholdMax (80.0f);
63
* demb.setResolution (64, 32);
64
*
65
* // Left view of the scene.
66
* demb.loadImage (left_image);
67
* // Disparity map of the scene.
68
* demb.loadDisparityMap ("disparity_map.txt", 640, 480);
69
*
70
* demb.compute(*cloud);
71
* \endcode
72
*
73
* \author Timur Ibadov (ibadov.timur@gmail.com)
74
* \ingroup stereo
75
*/
76
class
PCL_EXPORTS
DigitalElevationMapBuilder
:
public
DisparityMapConverter
<PointDEM> {
77
public
:
78
using
DisparityMapConverter<PointDEM>::baseline_
;
79
using
DisparityMapConverter<PointDEM>::translateCoordinates
;
80
using
DisparityMapConverter<PointDEM>::image_
;
81
using
DisparityMapConverter<PointDEM>::disparity_map_
;
82
using
DisparityMapConverter<PointDEM>::disparity_map_width_
;
83
using
DisparityMapConverter<PointDEM>::disparity_map_height_
;
84
using
DisparityMapConverter<PointDEM>::disparity_threshold_min_
;
85
using
DisparityMapConverter<PointDEM>::disparity_threshold_max_
;
86
87
/** \brief DigitalElevationMapBuilder constructor. */
88
DigitalElevationMapBuilder
();
89
90
/** \brief Empty destructor. */
91
~
DigitalElevationMapBuilder
();
92
93
/** \brief Set resolution of the DEM.
94
* \param[in] resolution_column the column resolution.
95
* \param[in] resolution_disparity the disparity resolution.
96
*/
97
void
98
setResolution(std::size_t resolution_column, std::size_t resolution_disparity);
99
100
/** \brief Get column resolution of the DEM.
101
* \return column resolution of the DEM.
102
*/
103
std::size_t
104
getColumnResolution()
const
;
105
106
/** \brief Get disparity resolution of the DEM.
107
* \return disparity resolution of the DEM.
108
*/
109
std::size_t
110
getDisparityResolution()
const
;
111
112
/** \brief Set minimum amount of points in a DEM's cell.
113
* \param[in] min_points_in_cell minimum amount of points in a DEM's cell.
114
*/
115
void
116
setMinPointsInCell(std::size_t min_points_in_cell);
117
118
/** \brief Get minimum amount of points in a DEM's cell.
119
* \return minimum amount of points in a DEM's cell.
120
*/
121
std::size_t
122
getMinPointsInCell()
const
;
123
124
/** \brief Compute the Digital Elevation Map.
125
* \param[out] out_cloud the variable to return the resulting cloud.
126
*/
127
void
128
compute(
pcl::PointCloud<PointDEM>
& out_cloud)
override
;
129
130
protected
:
131
/** \brief Column resolution of the DEM. */
132
std::size_t
resolution_column_
;
133
/** \brief disparity resolution of the DEM. */
134
std::size_t
resolution_disparity_
;
135
/** \brief Minimum amount of points in a DEM's cell. */
136
std::size_t
min_points_in_cell_
;
137
};
138
139
}
// namespace pcl
pcl
This file defines compatibility wrappers for low level I/O functions.
Definition:
convolution.h:45
point_types.h
pcl::DisparityMapConverter
Compute point cloud from the disparity map.
Definition:
disparity_map_converter.h:77
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition:
projection_matrix.h:52
pcl::DigitalElevationMapBuilder
Build a Digital Elevation Map in the column-disparity space from a disparity map and a color image of...
Definition:
digital_elevation_map.h:76
pcl::DigitalElevationMapBuilder::resolution_column_
std::size_t resolution_column_
Column resolution of the DEM.
Definition:
digital_elevation_map.h:132
pcl::DigitalElevationMapBuilder::min_points_in_cell_
std::size_t min_points_in_cell_
Minimum amount of points in a DEM's cell.
Definition:
digital_elevation_map.h:136
pcl::DigitalElevationMapBuilder::resolution_disparity_
std::size_t resolution_disparity_
disparity resolution of the DEM.
Definition:
digital_elevation_map.h:134
PCL_EXPORTS
#define PCL_EXPORTS
Definition:
pcl_macros.h:271