10 #include <benchmark/benchmark.h>
22 namespace registration {
34 pcd->EstimateNormals();
38 std::vector<size_t> indices_tmp;
39 size_t step = 1.0 / ratio_indices.
value();
40 size_t n_indices = pcd->size() / step;
41 indices_tmp.reserve(n_indices);
42 for (
size_t index = 0; index < pcd->size(); index += step) {
43 indices_tmp.push_back(index);
48 for (
auto _ : state) {
84 std::vector<int64_t> indices_tmp;
85 int64_t step = 1.0 / ratio_indices.
value();
87 indices_tmp.reserve(n_indices);
90 indices_tmp.push_back(index);
101 for (
auto _ : state) {
109 Legacy Hybrid[0.01 | 100],
113 ->Unit(benchmark::kMillisecond);
115 Legacy Hybrid[0.02 | 50],
119 ->Unit(benchmark::kMillisecond);
121 Legacy Hybrid[0.02 | 100],
125 ->Unit(benchmark::kMillisecond);
131 ->Unit(benchmark::kMillisecond);
137 ->Unit(benchmark::kMillisecond);
143 ->Unit(benchmark::kMillisecond);
149 ->Unit(benchmark::kMillisecond);
152 Legacy Hybrid Indices[0.02 | 50 |
null],
156 ->Unit(benchmark::kMillisecond);
158 Legacy Hybrid Indices[0.02 | 50 | 0.0001],
162 ->Unit(benchmark::kMillisecond);
164 Legacy Hybrid Indices[0.02 | 50 | 0.001],
168 ->Unit(benchmark::kMillisecond);
170 Legacy Hybrid Indices[0.02 | 50 | 0.01],
174 ->Unit(benchmark::kMillisecond);
176 Legacy Hybrid Indices[0.02 | 50 | 0.1],
180 ->Unit(benchmark::kMillisecond);
182 Legacy Hybrid Indices[0.02 | 50 | 1.0],
186 ->Unit(benchmark::kMillisecond);
188 #define ENUM_FPFH_METHOD_DEVICE(METHOD_NAME, MAX_NN, RADIUS, INDICES, DEVICE) \
189 BENCHMARK_CAPTURE(ComputeFPFHFeature, METHOD_NAME##_Float32, \
190 core::Device(DEVICE), core::Float32, MAX_NN, RADIUS, \
192 ->Unit(benchmark::kMillisecond); \
193 BENCHMARK_CAPTURE(ComputeFPFHFeature, METHOD_NAME##_Float64, \
194 core::Device(DEVICE), core::Float64, MAX_NN, RADIUS, \
196 ->Unit(benchmark::kMillisecond);
201 CPU[0.02 | 50] Hybrid, 50, 0.02, utility::
nullopt, "CPU:0")
203 CPU[0.02 | 100] Hybrid, 100, 0.02, utility::
nullopt, "CPU:0")
219 CPU[0.02 | 50 | 0.0001] Hybrid Indices, 50, 0.02, 0.0001, "CPU:0")
221 CPU[0.02 | 50 | 0.001] Hybrid Indices, 50, 0.02, 0.001, "CPU:0")
223 CPU[0.02 | 50 | 0.01] Hybrid Indices, 50, 0.02, 0.01, "CPU:0")
225 CPU[0.02 | 50 | 0.1] Hybrid Indices, 50, 0.02, 0.1, "CPU:0")
227 CPU[0.02 | 50 | 1.0] Hybrid Indices, 50, 0.02, 1.0, "CPU:0")
229 #ifdef BUILD_CUDA_MODULE
233 CUDA[0.02 | 50] Hybrid, 50, 0.02, utility::
nullopt, "CUDA:0")
235 CUDA[0.02 | 100] Hybrid, 100, 0.02, utility::
nullopt, "CUDA:0")
241 CUDA[0.01] Radius, utility::
nullopt, 0.01, utility::
nullopt, "CUDA:0")
243 CUDA[0.02] Radius, utility::
nullopt, 0.02, utility::
nullopt, "CUDA:0")
251 CUDA[0.02 | 50 | 0.0001] Hybrid Indices, 50, 0.02, 0.0001, "CUDA:0")
253 CUDA[0.02 | 50 | 0.001] Hybrid Indices, 50, 0.02, 0.001, "CUDA:0")
255 CUDA[0.02 | 50 | 0.01] Hybrid Indices, 50, 0.02, 0.01, "CUDA:0")
257 CUDA[0.02 | 50 | 0.1] Hybrid Indices, 50, 0.02, 0.1, "CUDA:0")
259 CUDA[0.02 | 50 | 1.0] Hybrid Indices, 50, 0.02, 1.0, "CUDA:0")
#define ENUM_FPFH_METHOD_DEVICE(METHOD_NAME, MAX_NN, RADIUS, INDICES, DEVICE)
int64_t GetLength() const
Tensor To(Dtype dtype, bool copy=false) const
Data class for BunnyMesh contains the BunnyMesh.ply from the Stanford 3D Scanning Repository.
std::string GetPath() const
Path to the BunnyMesh.ply file.
KDTree search parameters for hybrid KNN and radius search.
KDTree search parameters for pure KNN search.
KDTree search parameters for pure radius search.
A point cloud contains a list of 3D points.
void EstimateNormals(const utility::optional< int > max_nn=30, const utility::optional< double > radius=utility::nullopt)
Function to estimate point normals. If the point cloud normals exist, the estimated normals are orien...
void SetPointPositions(const core::Tensor &value)
Set the value of the "positions" attribute. Convenience function.
core::Tensor & GetPointPositions()
Get the value of the "positions" attribute. Convenience function.
PointCloud To(const core::Device &device, bool copy=false) const
PointCloud UniformDownSample(size_t every_k_points) const
Downsamples a point cloud by selecting every kth index point and its attributes.
void emplace(Args &&... args)
constexpr bool has_value() const noexcept
constexpr T const & value() const &
std::shared_ptr< ccPointCloud > CreatePointCloudFromFile(const std::string &filename, const std::string &format, bool print_progress)
bool ReadPointCloud(const std::string &filename, geometry::PointCloud &pointcloud, const cloudViewer::io::ReadPointCloudOption ¶ms)
static const std::string path
core::Tensor ComputeFPFHFeature(const geometry::PointCloud &input, const utility::optional< int > max_nn, const utility::optional< double > radius, const utility::optional< core::Tensor > &indices)
void LegacyComputeFPFHFeature(benchmark::State &state, utility::optional< int > max_nn, utility::optional< double > radius, utility::optional< double > ratio_indices)
BENCHMARK_CAPTURE(LegacyComputeFPFHFeature, Legacy Hybrid[0.01|100], 100, 0.01, utility::nullopt) -> Unit(benchmark::kMillisecond)
data::BunnyMesh pointcloud_ply
constexpr nullopt_t nullopt
std::shared_ptr< Feature > ComputeFPFHFeature(const ccPointCloud &input, const geometry::KDTreeSearchParam &search_param=geometry::KDTreeSearchParamKNN(), const utility::optional< std::vector< size_t >> &indices=utility::nullopt)
Generic file read and write utility for python interface.