Shashwat
Shashwat

Reputation: 2668

Height and width in pclPointCloud

Why do we have height and width in pclPointCloud? The API documentation here says that

The point cloud height (if organized as an image-structure).

What does "image-structure" mean here?

Also, I noticed that it gives exception when the number of points is not equal to width * height. Isn't cloud->points a vector in which we can just push_back any number of elements?

Upvotes: 3

Views: 3816

Answers (1)

taketwo
taketwo

Reputation: 1251

Organized point cloud is a point cloud obtained by projecting depth image into 3D space. In an image the pixels are organized in rows and columns, therefore the same holds for the points in the point cloud derived from it. "Organizedness" is a sort of meta information about point cloud. One can design more efficient algorithms by utilizing the fact that the points derived from neighboring pixels are likely to be close in 3D space.

You can push arbitrary points into a point cloud, however you need to update the information in width and height fields to match the true size of the point cloud. Note that when you add arbitrary points, the resulting cloud is definitely non-organized, so by convention height should be set to 1.

Upvotes: 3

Related Questions