dimatura / pypcd

PCL pcd fileformat i/o in Python
Other
266 stars 196 forks source link

Convert binary PCD to ascii PCD with RGB column #17

Open agutif opened 5 years ago

agutif commented 5 years ago

Hi,

I am using pypcd to convert from binary PCD file to ascii PCD file without installing PCL in my system. My original binary PCD file has x, y, z and rgb data and I use the following code to read it and save it with ascii format:

pc = pypcd.PointCloud.from_path('binary_input.pcd')
pc.save_pcd('ascii_output.pcd', compression='ascii')

All works fine except for the rgb column. The output ascii file has all RGB values set to 0.0.

But if I use this snippet of code I can print the RGB values:

rgb_columns = pypcd.decode_rgb_from_pcl(cloud.pc_data['rgb'])

Thanks.

XinnWang commented 3 years ago

@agutif i met the same problem, have you solved it?

agutf commented 3 years ago

@agutif i met the same problem, have you solved it?

Finally I solved it by converting only x, y and z with pypcd. Then, I coded a simple program to convert the rgb column and merge it with the previously converted x, y and z file.