Skip to content

Commit

Permalink
fix non-SSE2 impl for project3D pointcloud
Browse files Browse the repository at this point in the history
Closes #810
  • Loading branch information
jlblancoc committed Nov 13, 2018
1 parent 8e4dfec commit b44afcd
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -155,18 +155,19 @@ void project3DPointsFromDepthImageInto(
src_obs.rangeImage.rows()); src_obs.rangeImage.rows());
} }
#if MRPT_HAS_SSE2 #if MRPT_HAS_SSE2
// if image width is not 8*N, use standard method
if ((W & 0x07) == 0 && projectParams.USE_SSE2) if ((W & 0x07) == 0 && projectParams.USE_SSE2)
do_project_3d_pointcloud_SSE2( do_project_3d_pointcloud_SSE2(
H, W, kys, kzs, src_obs.rangeImage, pca, H, W, kys, kzs, src_obs.rangeImage, pca,
src_obs.points3D_idxs_x, src_obs.points3D_idxs_y, src_obs.points3D_idxs_x, src_obs.points3D_idxs_y,
filterParams, projectParams.MAKE_DENSE); filterParams, projectParams.MAKE_DENSE);
else else
{
do_project_3d_pointcloud( do_project_3d_pointcloud(
H, W, kys, kzs, src_obs.rangeImage, pca, H, W, kys, kzs, src_obs.rangeImage, pca,
src_obs.points3D_idxs_x, src_obs.points3D_idxs_y, src_obs.points3D_idxs_x, src_obs.points3D_idxs_y,
filterParams, projectParams.MAKE_DENSE); // if image width filterParams, projectParams.MAKE_DENSE);
// is not 8*N, use }
// standard method
#else #else
do_project_3d_pointcloud( do_project_3d_pointcloud(
H, W, kys, kzs, src_obs.rangeImage, pca, H, W, kys, kzs, src_obs.rangeImage, pca,
Expand Down Expand Up @@ -343,6 +344,7 @@ inline void do_project_3d_pointcloud(
for (int c = 0; c < W; c++) for (int c = 0; c < W; c++)
{ {
const float D = rangeImage.coeff(r, c); const float D = rangeImage.coeff(r, c);
const auto kx = *kys++, kz = *kzs++; // LUT projection coefs.
if (!rif.do_range_filter(r, c, D)) if (!rif.do_range_filter(r, c, D))
{ {
if (!MAKE_DENSE) if (!MAKE_DENSE)
Expand All @@ -353,7 +355,7 @@ inline void do_project_3d_pointcloud(
continue; continue;
} }


pca.setPointXYZ(idx, D /*x*/, *kys++ * D /*y*/, *kzs++ * D /*z*/); pca.setPointXYZ(idx, D /*x*/, kx * D /*y*/, kz * D /*z*/);
idxs_x[idx] = c; idxs_x[idx] = c;
idxs_y[idx] = r; idxs_y[idx] = r;
++idx; ++idx;
Expand Down

0 comments on commit b44afcd

Please sign in to comment.