29 const float max_range) {
31 for (
const Eigen::Vector3f& point : point_cloud) {
32 if (point.norm() <= max_range) {
33 result.push_back(point);
40 const proto::AdaptiveVoxelFilterOptions& options,
42 if (point_cloud.size() <= options.min_num_points()) {
47 if (result.size() >= options.min_num_points()) {
54 for (
float high_length = options.max_length();
55 high_length > 1e-2f * options.max_length(); high_length /= 2.f) {
56 float low_length = high_length / 2.f;
58 if (result.size() >= options.min_num_points()) {
62 while ((high_length - low_length) / low_length > 1e-1f) {
63 const float mid_length = (low_length + high_length) / 2.f;
65 if (candidate.size() >= options.min_num_points()) {
66 low_length = mid_length;
69 high_length = mid_length;
89 for (
const Eigen::Vector3f& point : point_cloud) {
102 proto::AdaptiveVoxelFilterOptions options;
103 options.set_max_length(parameter_dictionary->
GetDouble(
"max_length"));
104 options.set_min_num_points(
106 options.set_max_range(parameter_dictionary->
GetDouble(
"max_range"));
111 const proto::AdaptiveVoxelFilterOptions& options)
115 return AdaptivelyVoxelFiltered(
const PointCloud & point_cloud() const
proto::RangeDataInserterOptions options_
Eigen::Array3i GetCellIndex(const Eigen::Vector3f &point) const
int GetNonNegativeInt(const string &key)
PointCloud VoxelFiltered(const PointCloud &point_cloud, const float size)
void InsertPointCloud(const PointCloud &point_cloud)
AdaptiveVoxelFilter(const proto::AdaptiveVoxelFilterOptions &options)
double GetDouble(const string &key)
PointCloud Filter(const PointCloud &point_cloud) const
ValueType * mutable_value(const Eigen::Array3i &index)
std::vector< Eigen::Vector3f > PointCloud
proto::AdaptiveVoxelFilterOptions CreateAdaptiveVoxelFilterOptions(common::LuaParameterDictionary *const parameter_dictionary)
const proto::AdaptiveVoxelFilterOptions options_
mapping_3d::HybridGridBase< uint8 > voxels_