Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
pcl
range_image
range_image_spherical.h
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Copyright (c) 2012-, Open Perception, 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 the copyright holder(s) 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
#pragma once
36
37
#include <pcl/range_image/range_image.h>
38
39
namespace
pcl
40
{
41
/** \brief @b RangeImageSpherical is derived from the original range image and uses a slightly different
42
* spherical projection. In the original range image, the image will appear more and more
43
* "scaled down" along the y axis, the further away from the mean line of the image a point is.
44
* This class removes this scaling, which makes it especially suitable for spinning LIDAR sensors
45
* that capure a 360° view, since a rotation of the sensor will now simply correspond to a shift of the
46
* range image. (This class is similar to RangeImagePlanar, but changes less of the behaviour of the base class.)
47
* \author Andreas Muetzel
48
* \ingroup range_image
49
*/
50
class
RangeImageSpherical
:
public
RangeImage
51
{
52
public
:
53
// =====TYPEDEFS=====
54
using
BaseClass
=
RangeImage
;
55
using
Ptr
= shared_ptr<RangeImageSpherical>;
56
using
ConstPtr
= shared_ptr<const RangeImageSpherical>;
57
58
// =====CONSTRUCTOR & DESTRUCTOR=====
59
/** Constructor */
60
PCL_EXPORTS
RangeImageSpherical
() {}
61
/** Destructor */
62
PCL_EXPORTS
virtual
~RangeImageSpherical
() =
default
;
63
64
/** Return a newly created RangeImagePlanar.
65
* Reimplementation to return an image of the same type. */
66
virtual
RangeImage
*
67
getNew
()
const
{
return
new
RangeImageSpherical
; }
68
69
// =====PUBLIC METHODS=====
70
/** \brief Get a boost shared pointer of a copy of this */
71
inline
Ptr
72
makeShared
() {
return
Ptr
(
new
RangeImageSpherical
(*
this
)); }
73
74
75
// Since we reimplement some of these overloaded functions, we have to do the following:
76
using
RangeImage::calculate3DPoint
;
77
using
RangeImage::getImagePoint
;
78
79
/** \brief Calculate the 3D point according to the given image point and range
80
* \param image_x the x image position
81
* \param image_y the y image position
82
* \param range the range
83
* \param point the resulting 3D point
84
* \note Implementation according to planar range images (compared to spherical as in the original)
85
*/
86
virtual
inline
void
87
calculate3DPoint
(
float
image_x,
float
image_y,
float
range, Eigen::Vector3f& point)
const
;
88
89
/** \brief Calculate the image point and range from the given 3D point
90
* \param point the resulting 3D point
91
* \param image_x the resulting x image position
92
* \param image_y the resulting y image position
93
* \param range the resulting range
94
* \note Implementation according to planar range images (compared to spherical as in the original)
95
*/
96
virtual
inline
void
97
getImagePoint
(
const
Eigen::Vector3f& point,
float
& image_x,
float
& image_y,
float
& range)
const
;
98
99
/** Get the angles corresponding to the given image point */
100
inline
void
101
getAnglesFromImagePoint
(
float
image_x,
float
image_y,
float
& angle_x,
float
& angle_y)
const
;
102
103
/** Get the image point corresponding to the given ranges */
104
inline
void
105
getImagePointFromAngles
(
float
angle_x,
float
angle_y,
float
& image_x,
float
& image_y)
const
;
106
107
};
108
}
// namespace end
109
110
111
#include <pcl/range_image/impl/range_image_spherical.hpp>
// Definitions of templated and inline functions
pcl::Ptr
pcl::RangeImage::calculate3DPoint
void calculate3DPoint(float image_x, float image_y, float range, PointWithRange &point) const
Calculate the 3D point according to the given image point and range.
Definition
range_image.hpp:592
pcl::RangeImage::getImagePoint
virtual void getImagePoint(const Eigen::Vector3f &point, float &image_x, float &image_y, float &range) const
Get imagePoint from 3D point in world coordinates.
Definition
range_image.hpp:357
pcl::RangeImage::RangeImage
PCL_EXPORTS RangeImage()
Constructor.
pcl::RangeImageSpherical::RangeImageSpherical
PCL_EXPORTS RangeImageSpherical()
Constructor.
Definition
range_image_spherical.h:60
pcl::RangeImageSpherical::makeShared
Ptr makeShared()
Get a boost shared pointer of a copy of this.
Definition
range_image_spherical.h:72
pcl::RangeImageSpherical::calculate3DPoint
virtual void calculate3DPoint(float image_x, float image_y, float range, Eigen::Vector3f &point) const
Calculate the 3D point according to the given image point and range.
Definition
range_image_spherical.hpp:48
pcl::RangeImageSpherical::BaseClass
RangeImage BaseClass
Definition
range_image_spherical.h:54
pcl::RangeImageSpherical::Ptr
shared_ptr< RangeImageSpherical > Ptr
Definition
range_image_spherical.h:55
pcl::RangeImageSpherical::getAnglesFromImagePoint
void getAnglesFromImagePoint(float image_x, float image_y, float &angle_x, float &angle_y) const
Get the angles corresponding to the given image point.
Definition
range_image_spherical.hpp:70
pcl::RangeImageSpherical::getImagePointFromAngles
void getImagePointFromAngles(float angle_x, float angle_y, float &image_x, float &image_y) const
Get the image point corresponding to the given ranges.
Definition
range_image_spherical.hpp:77
pcl::RangeImageSpherical::getImagePoint
virtual void getImagePoint(const Eigen::Vector3f &point, float &image_x, float &image_y, float &range) const
Calculate the image point and range from the given 3D point.
Definition
range_image_spherical.hpp:60
pcl::RangeImageSpherical::getNew
virtual RangeImage * getNew() const
Return a newly created RangeImagePlanar.
Definition
range_image_spherical.h:67
pcl::RangeImageSpherical::~RangeImageSpherical
virtual PCL_EXPORTS ~RangeImageSpherical()=default
Destructor.
pcl::RangeImageSpherical::ConstPtr
shared_ptr< const RangeImageSpherical > ConstPtr
Definition
range_image_spherical.h:56
pcl
Definition
convolution.h:46