fixed laserScanFromDepthImage order (counterclockwise)

This commit is contained in:
matlabbe
2017-02-24 15:26:42 -05:00
parent b0170d1f6f
commit 3cf21a7e7f
2 changed files with 10 additions and 2 deletions

View File

@@ -1109,7 +1109,7 @@ pcl::PointCloud<pcl::PointXYZ> laserScanFromDepthImage(
{
scan.resize(depthImage.cols);
int oi = 0;
for(int i=0; i<depthImage.cols; ++i)
for(int i=depthImage.cols-1; i>=0; --i)
{
pcl::PointXYZ pt = util3d::projectDepthTo3D(depthImage, i, middle, cx, cy, fx, fy, false);
if(pcl::isFinite(pt) && pt.z >= minDepth && (maxDepth == 0 || pt.z < maxDepth))
@@ -1135,7 +1135,7 @@ pcl::PointCloud<pcl::PointXYZ> laserScanFromDepthImages(
pcl::PointCloud<pcl::PointXYZ> scan;
UASSERT(int((depthImages.cols/cameraModels.size())*cameraModels.size()) == depthImages.cols);
int subImageWidth = depthImages.cols/cameraModels.size();
for(unsigned int i=0; i<cameraModels.size(); ++i)
for(int i=(int)cameraModels.size()-1; i>=0; --i)
{
if(cameraModels[i].isValidForProjection())
{