Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
pcl
surface
marching_cubes_hoppe.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
#pragma once
37
38
#include <
pcl/memory.h
>
39
#include <
pcl/pcl_macros.h
>
40
#include <pcl/surface/marching_cubes.h>
41
42
namespace
pcl
43
{
44
/** \brief The marching cubes surface reconstruction algorithm, using a signed distance function based on the distance
45
* from tangent planes, proposed by Hoppe et. al. in:
46
* Hoppe H., DeRose T., Duchamp T., MC-Donald J., Stuetzle W., "Surface reconstruction from unorganized points",
47
* SIGGRAPH '92
48
* \tparam PointNT Use `pcl::PointNormal` or `pcl::PointXYZRGBNormal` or `pcl::PointXYZINormal`
49
* \author Alexandru E. Ichim
50
* \ingroup surface
51
*/
52
template
<
typename
Po
int
NT>
53
class
MarchingCubesHoppe
:
public
MarchingCubes
<PointNT>
54
{
55
public
:
56
using
Ptr
= shared_ptr<MarchingCubesHoppe<PointNT> >;
57
using
ConstPtr
= shared_ptr<const MarchingCubesHoppe<PointNT> >;
58
59
using
SurfaceReconstruction
<PointNT>
::input_
;
60
using
SurfaceReconstruction
<PointNT>
::tree_
;
61
using
MarchingCubes
<PointNT>
::grid_
;
62
using
MarchingCubes
<PointNT>
::res_x_
;
63
using
MarchingCubes
<PointNT>
::res_y_
;
64
using
MarchingCubes
<PointNT>
::res_z_
;
65
using
MarchingCubes
<PointNT>
::size_voxel_
;
66
using
MarchingCubes
<PointNT>
::upper_boundary_
;
67
using
MarchingCubes
<PointNT>
::lower_boundary_
;
68
69
using
PointCloudPtr
=
typename
pcl::PointCloud<PointNT>::Ptr
;
70
71
using
KdTree
=
pcl::KdTree<PointNT>
;
72
using
KdTreePtr
=
typename
KdTree::Ptr
;
73
74
75
/** \brief Constructor. */
76
MarchingCubesHoppe
(
const
float
dist_ignore = -1.0f,
77
const
float
percentage_extend_grid = 0.0f,
78
const
float
iso_level = 0.0f) :
79
MarchingCubes
<PointNT> (percentage_extend_grid, iso_level),
80
dist_ignore_
(dist_ignore)
81
{
82
}
83
84
/** \brief Destructor. */
85
~MarchingCubesHoppe
()
override
;
86
87
/** \brief Convert the point cloud into voxel data.
88
*/
89
void
90
voxelizeData
()
override
;
91
92
/** \brief Method that sets the distance for ignoring voxels which are far from point cloud.
93
* If the distance is negative, then the distance functions would be calculated in all voxels;
94
* otherwise, only voxels with distance lower than dist_ignore would be involved in marching cube.
95
* \param[in] dist_ignore threshold of distance. Default value is -1.0. Set to negative if all voxels are
96
* to be involved.
97
*/
98
inline
void
99
setDistanceIgnore
(
const
float
dist_ignore)
100
{
dist_ignore_
= dist_ignore; }
101
102
/** \brief get the distance for ignoring voxels which are far from point cloud.
103
* */
104
inline
float
105
getDistanceIgnore
()
const
106
{
return
dist_ignore_
; }
107
108
protected
:
109
/** \brief ignore the distance function
110
* if it is negative
111
* or distance between voxel centroid and point are larger that it. */
112
float
dist_ignore_
;
113
114
public
:
115
PCL_MAKE_ALIGNED_OPERATOR_NEW
116
};
117
}
118
119
#ifdef PCL_NO_PRECOMPILE
120
#include <pcl/surface/impl/marching_cubes_hoppe.hpp>
121
#endif
pcl::KdTree
KdTree represents the base spatial locator class for kd-tree implementations.
Definition
kdtree.h:56
pcl::KdTree< PointNT >::Ptr
shared_ptr< KdTree< PointNT > > Ptr
Definition
kdtree.h:69
pcl::MarchingCubesHoppe::KdTreePtr
typename KdTree::Ptr KdTreePtr
Definition
marching_cubes_hoppe.h:72
pcl::MarchingCubesHoppe::Ptr
shared_ptr< MarchingCubesHoppe< PointNT > > Ptr
Definition
marching_cubes_hoppe.h:56
pcl::MarchingCubesHoppe::PointCloudPtr
typename pcl::PointCloud< PointNT >::Ptr PointCloudPtr
Definition
marching_cubes_hoppe.h:69
pcl::MarchingCubesHoppe::getDistanceIgnore
float getDistanceIgnore() const
get the distance for ignoring voxels which are far from point cloud.
Definition
marching_cubes_hoppe.h:105
pcl::MarchingCubesHoppe::~MarchingCubesHoppe
~MarchingCubesHoppe() override
Destructor.
pcl::MarchingCubesHoppe::ConstPtr
shared_ptr< const MarchingCubesHoppe< PointNT > > ConstPtr
Definition
marching_cubes_hoppe.h:57
pcl::MarchingCubesHoppe::MarchingCubesHoppe
MarchingCubesHoppe(const float dist_ignore=-1.0f, const float percentage_extend_grid=0.0f, const float iso_level=0.0f)
Constructor.
Definition
marching_cubes_hoppe.h:76
pcl::MarchingCubesHoppe::voxelizeData
void voxelizeData() override
Convert the point cloud into voxel data.
Definition
marching_cubes_hoppe.hpp:48
pcl::MarchingCubesHoppe::KdTree
pcl::KdTree< PointNT > KdTree
Definition
marching_cubes_hoppe.h:71
pcl::MarchingCubesHoppe::dist_ignore_
float dist_ignore_
ignore the distance function if it is negative or distance between voxel centroid and point are large...
Definition
marching_cubes_hoppe.h:112
pcl::MarchingCubesHoppe::setDistanceIgnore
void setDistanceIgnore(const float dist_ignore)
Method that sets the distance for ignoring voxels which are far from point cloud.
Definition
marching_cubes_hoppe.h:99
pcl::MarchingCubes::grid_
std::vector< float > grid_
The data structure storing the 3D grid.
Definition
marching_cubes.h:439
pcl::MarchingCubes::res_x_
int res_x_
The grid resolution.
Definition
marching_cubes.h:442
pcl::MarchingCubes::upper_boundary_
Eigen::Array3f upper_boundary_
bounding box
Definition
marching_cubes.h:445
pcl::MarchingCubes::size_voxel_
Eigen::Array3f size_voxel_
size of voxels
Definition
marching_cubes.h:449
pcl::MarchingCubes::MarchingCubes
MarchingCubes(const float percentage_extend_grid=0.0f, const float iso_level=0.0f)
Constructor.
Definition
marching_cubes.h:379
pcl::MarchingCubes::res_y_
int res_y_
Definition
marching_cubes.h:442
pcl::MarchingCubes::res_z_
int res_z_
Definition
marching_cubes.h:442
pcl::MarchingCubes::lower_boundary_
Eigen::Array3f lower_boundary_
Definition
marching_cubes.h:446
pcl::PCLBase< PointNT >::input_
PointCloudConstPtr input_
Definition
pcl_base.h:147
pcl::PCLSurfaceBase< PointNT >::tree_
KdTreePtr tree_
Definition
reconstruction.h:96
pcl::PointCloud::Ptr
shared_ptr< PointCloud< PointT > > Ptr
Definition
point_cloud.h:414
pcl::SurfaceReconstruction
SurfaceReconstruction represents a base surface reconstruction class.
Definition
reconstruction.h:118
PCL_MAKE_ALIGNED_OPERATOR_NEW
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Definition
memory.h:86
memory.h
Defines functions, macros and traits for allocating and using memory.
pcl
Definition
convolution.h:46
pcl_macros.h
Defines all the PCL and non-PCL macros used.