Skip to content

Commit 883f6c5

Browse files
committed
updated estimateProjectionMatrix() to make the down-sampled image have the same number of points for each row (e.g. given a 5x5 input with x/yskip=2, the downsampled image now has 3 points for each row instead of 3,2,3 points for each row)
1 parent 24320e5 commit 883f6c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

search/include/pcl/search/impl/organized.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,14 @@ pcl::search::OrganizedNeighbor<PointT>::estimateProjectionMatrix ()
350350
std::vector<int> indices;
351351
indices.reserve (input_->size () >> (pyramid_level_ << 1));
352352

353-
for (unsigned yIdx = 0, idx = 0; yIdx < input_->height; yIdx += ySkip, idx += input_->width * (ySkip - 1))
353+
for (unsigned yIdx = 0, idx = 0; yIdx < input_->height; yIdx += ySkip, idx += input_->width * ySkip)
354354
{
355-
for (unsigned xIdx = 0; xIdx < input_->width; xIdx += xSkip, idx += xSkip)
355+
for (unsigned xIdx = 0, idx2 = idx; xIdx < input_->width; xIdx += xSkip, idx2 += xSkip)
356356
{
357-
if (!mask_ [idx])
357+
if (!mask_ [idx2])
358358
continue;
359359

360-
indices.push_back (idx);
360+
indices.push_back (idx2);
361361
}
362362
}
363363

0 commit comments

Comments
 (0)