+ handling of organized point cloud

This commit is contained in:
wmayer
2016-02-20 22:19:47 +01:00
parent 60e0c447ca
commit 7bdecf9b38
9 changed files with 159 additions and 5 deletions

View File

@@ -122,6 +122,8 @@ void PointsAlgos::LoadAscii(PointKernel &points, const char *FileName)
Reader::Reader()
{
width = 0;
height = 0;
}
Reader::~Reader()
@@ -175,6 +177,21 @@ bool Reader::hasNormals() const
return (!normals.empty());
}
bool Reader::isOrganized() const
{
return (width > 1 && height > 1);
}
int Reader::getWidth() const
{
return width;
}
int Reader::getHeight() const
{
return height;
}
// ----------------------------------------------------------------------------
AscReader::AscReader()
@@ -351,6 +368,9 @@ void PcdReader::read(const std::string& filename)
hasColors = true;
}
width = cloud2.width;
height = cloud2.height;
if (hasNormals && hasColors) {
pcl::PointCloud<pcl::PointXYZRGBNormal> cloud_in;
pcl::io::loadPCDFile<pcl::PointXYZRGBNormal>(filename, cloud_in);