83 indices.resize (indices_->size ());
91 std::int64_t dx =
static_cast<std::int64_t
> ((
max_p[0] -
min_p[0]) * inverse_resolution_)+1;
92 std::int64_t
dy =
static_cast<std::int64_t
> ((
max_p[1] -
min_p[1]) * inverse_resolution_)+1;
94 if ((dx*
dy) >
static_cast<std::int64_t
> (std::numeric_limits<std::int32_t>::max ()))
96 PCL_WARN (
"[pcl::%s::applyFilter] Leaf size is too small for the input dataset. Integer indices would overflow.\n", getClassName ().
c_str ());
103 min_b[0] =
static_cast<int> (std::floor (
min_p[0] * inverse_resolution_));
104 max_b[0] =
static_cast<int> (std::floor (
max_p[0] * inverse_resolution_));
105 min_b[1] =
static_cast<int> (std::floor (
min_p[1] * inverse_resolution_));
106 max_b[1] =
static_cast<int> (std::floor (
max_p[1] * inverse_resolution_));
121 for (
const auto& index : (*indices_))
123 if (!input_->is_dense)
128 int ijk0 =
static_cast<int> (std::floor ((*input_)[index].x * inverse_resolution_) -
static_cast<float> (
min_b[0]));
129 int ijk1 =
static_cast<int> (std::floor ((*input_)[index].y * inverse_resolution_) -
static_cast<float> (
min_b[1]));
133 index_vector.emplace_back(
static_cast<unsigned int> (idx), index);
142 unsigned int total = 0;
143 unsigned int index = 0;
154 unsigned int i = index + 1;
163 indices.resize (
total);
191 indices.resize (
oii);