diff --git a/core/src/point_cloud.cpp b/core/src/point_cloud.cpp index f9f4284f..57d14eac 100644 --- a/core/src/point_cloud.cpp +++ b/core/src/point_cloud.cpp @@ -149,9 +149,9 @@ bool PointCloud::load_pc(const std::string& input_file_name, bool load_cache_mod this->intensities.clear(); this->timestamps.clear(); - this->points_local.resize(npoints); - this->intensities.resize(npoints); - this->timestamps.resize(npoints); + this->points_local.reserve(npoints); + this->intensities.reserve(npoints); + this->timestamps.reserve(npoints); while (p_count < npoints) { diff --git a/core/src/point_clouds.cpp b/core/src/point_clouds.cpp index eac47cb8..056958b4 100644 --- a/core/src/point_clouds.cpp +++ b/core/src/point_clouds.cpp @@ -1317,6 +1317,11 @@ bool PointClouds::load_whu_tls( point_clouds[i].points_local[j] -= this->offset; } + size_t total_points = 0; + for (int i = 0; i < point_clouds.size(); i++) + total_points += point_clouds[i].points_local.size(); + std::cout << "total points loaded: " << total_points << std::endl; + print_point_cloud_dimension(); const auto end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end - start;