Flipped color for some PCD files
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!
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
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.
Thanks for the contribution! Closing issue.