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
Operating System and version: Ubuntu 16.04 LTS
Compiler: gcc
PCL Version:
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
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