Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
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/stereo/disparity_map_converter.h>
40
#include <
pcl/point_types.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
()
override
;
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_
{64};
133
/** \brief disparity resolution of the DEM. */
134
std::size_t
resolution_disparity_
{32};
135
/** \brief Minimum amount of points in a DEM's cell. */
136
std::size_t
min_points_in_cell_
{1};
137
};
138
139
}
// namespace pcl
pcl::DigitalElevationMapBuilder::~DigitalElevationMapBuilder
~DigitalElevationMapBuilder() override
Empty destructor.
pcl::DigitalElevationMapBuilder::resolution_column_
std::size_t resolution_column_
Column resolution of the DEM.
Definition
digital_elevation_map.h:132
pcl::DigitalElevationMapBuilder::resolution_disparity_
std::size_t resolution_disparity_
disparity resolution of the DEM.
Definition
digital_elevation_map.h:134
pcl::DigitalElevationMapBuilder::setResolution
void setResolution(std::size_t resolution_column, std::size_t resolution_disparity)
Set resolution of the DEM.
pcl::DigitalElevationMapBuilder::DigitalElevationMapBuilder
DigitalElevationMapBuilder()
DigitalElevationMapBuilder constructor.
pcl::DigitalElevationMapBuilder::getMinPointsInCell
std::size_t getMinPointsInCell() const
Get minimum amount of points in a DEM's cell.
pcl::DigitalElevationMapBuilder::getDisparityResolution
std::size_t getDisparityResolution() const
Get disparity resolution of the DEM.
pcl::DigitalElevationMapBuilder::compute
void compute(pcl::PointCloud< PointDEM > &out_cloud) override
Compute the Digital Elevation Map.
pcl::DigitalElevationMapBuilder::getColumnResolution
std::size_t getColumnResolution() const
Get column resolution of the DEM.
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::setMinPointsInCell
void setMinPointsInCell(std::size_t min_points_in_cell)
Set minimum amount of points in a DEM's cell.
pcl::DisparityMapConverter< PointDEM >::disparity_map_
std::vector< float > disparity_map_
Definition
disparity_map_converter.h:245
pcl::DisparityMapConverter< PointDEM >::image_
pcl::PointCloud< pcl::RGB >::ConstPtr image_
Definition
disparity_map_converter.h:242
pcl::DisparityMapConverter< PointDEM >::disparity_threshold_max_
float disparity_threshold_max_
Definition
disparity_map_converter.h:253
pcl::DisparityMapConverter< PointDEM >::baseline_
float baseline_
Definition
disparity_map_converter.h:237
pcl::DisparityMapConverter< PointDEM >::translateCoordinates
PointXYZ translateCoordinates(std::size_t row, std::size_t column, float disparity) const
Definition
disparity_map_converter.hpp:295
pcl::DisparityMapConverter< PointDEM >::DisparityMapConverter
DisparityMapConverter()
Definition
disparity_map_converter.hpp:49
pcl::DisparityMapConverter< PointDEM >::disparity_map_height_
std::size_t disparity_map_height_
Definition
disparity_map_converter.h:249
pcl::DisparityMapConverter< PointDEM >::disparity_map_width_
std::size_t disparity_map_width_
Definition
disparity_map_converter.h:247
pcl::DisparityMapConverter< PointDEM >::disparity_threshold_min_
float disparity_threshold_min_
Definition
disparity_map_converter.h:252
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition
point_cloud.h:174
point_types.h
Defines all the PCL implemented PointT point type structures.
pcl
Definition
convolution.h:46
pcl::PointDEM
A point structure representing Digital Elevation Map.
Definition
point_types.hpp:1702