Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

Flipped color for some PCD files

Open zjudmd opened this issue 8 years ago • 3 comments

Hi Authors,

When I tried to open some PCD files using draw_geometries function, color of some pointclouds was flipped (seems like from RGB to BGR), while some were not. The differences I can find among these PCD files are mainly following: 1/ Organized data (original color) and unorganized (flipped color); 2/ 'DATA' type is hex (original color) and ascii (flipped color).

FYI: two PCD files are attached. pcdfile.zip

Thanks!

zjudmd avatar Feb 23 '18 05:02 zjudmd

We had this issue before #45. I need to collect more cases to debug.

I see the shared file has

  • organized_hex.pcd (looks good)
  • unorganized_ascii.pcd. (BGR)

Can you also generate either two cases?

  • unorganized_binary.pcd
  • organized_ascii.pcd

I am suspicious about color decoding for ascii format. If it is the case, you can fix it by changing RGB channel order in following function and create PR for this. https://github.com/IntelVCL/Open3D/blob/53fe62d1a8574a581a5b71c7999759bf3be50262/src/IO/FileFormat/FilePCD.cpp#L311-L332

syncle avatar Feb 23 '18 06:02 syncle

I've tested both

  • unorganized_binary.pcd (looks good)
  • organized_ascii.pcd (flipped color, something like BGR)

I found that ascii format PCD files all had this color bug, whether they were organized or unorganized. I modified your mentioned function in Open3D/src/IO/FileFormat/FilePCD.cpp and rebuilt it, now it looks good for those ascii format PCD files.

I have created PR for this.

Thanks.

zjudmd avatar Feb 23 '18 08:02 zjudmd

Thanks for the contribution! Closing issue.

syncle avatar Feb 23 '18 15:02 syncle