PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
9.79k stars 4.6k forks source link

Image reconstruction from BearingAngleImage not working #3048

Open bonoloucl opened 5 years ago

bonoloucl commented 5 years ago

Using the PCL BearingAngleImage class updates points in the input point cloud to contain grayscale values proportional to the bearing angles calculated. Reconstructing the image from these points does not work.

Your Environment

Context

Trying to construct a 2D image from a 3D pointcloud

Expected Behavior

Output a 2D image

Current Behavior

3D points are provided but the ordering is unclear

Code to Reproduce

pcl::BearingAngleImage bearing_angle_image; bearing_angle_image.generateBAImage(*pcl_cloud_xyz); cv::Mat Im(bearing_angle_image.height, bearing_angle_image.width, CV_8UC1, cv::Scalar(255)); int count = 0; for (int i=0; i< bearing_angle_image.height-1; i++) { for (int j=0; j< bearing_angle_image.width-1; j++) { Im.at(i,j) = (bearing_angle_image.points[count].rgba >> 8) & 0xff; count++; } } cv::namedWindow("image"); cv::imshow("image", Im); cv::waitKey(0); cv::destroyAllWindows();

Possible Solution

The function should return an image, or maybe provide documentation on how to reconstruct this

stale[bot] commented 4 years ago

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.