PointCloud_PointXYZRGB from_array method probably broken
Hi,
I have a problem when executing the following code:
pointcloud_np = pointcloud.to_array() p = pcl.PointCloud_PointXYZRGB() p.from_array(pointcloud_np)
After that all previously present color information in the pointcloud is lost. All RGB values are set to zero. PCL version is 1.8.1 on Windows.
@dani2112, I am facing the same issue.
I'm also facing the same problem. Do you find a solution or an alternative way to add color information?_
I convert the numpy array to a list, then use from_list method and can finally add color information to the pointcloud.
@dani2112, @yanjiaweisysu Here is the code which I modified.
p = pcl.PointCloud_PointXYZRGBA()
p.from_array(np.array(ptcloud_centred, dtype=np.float32))
visual = pcl_visualization.CloudViewing()
visual.ShowColorCloud(p)
def check_was_stopped():
visual.WasStopped()
root.after(100, check_was_stopped)
check_was_stopped()
I hope this will help you. :) RGB has some issues regarding display. So, I have used RGBA which is similar to RGB
I convert the numpy array to a list, then use from_list method and can finally add color information to the pointcloud.
it doesnt work.