davidcaron / pclpy

Python bindings for the Point Cloud Library (PCL)
MIT License
428 stars 59 forks source link

How to display the file as it is if it does not have red color #14

Closed niranjanreddy891 closed 6 years ago

niranjanreddy891 commented 6 years ago

Lets say I have a las file, it has blue and green colors but no red color. How to display the file with the colors it has. i.e; if the file doesn't have red color, instead of throwing Dimension red not found error or any other color error, it has to display the colors as it is in the file. How to do it

As a reference I have this file las14_type6_ALS_RIEGL_VQ580.zip

davidcaron commented 6 years ago

Well that's an unusual case...

If your file has only blue and green, and the red field is absent, it doesn't comply with the las standard...

But that's still possible. So in that case, you would have to create a red field with zeroes in it. Then the file will display just fine.

Dimension red not found is a laspy error because red is the first color dimension it's looking for.

niranjanreddy891 commented 6 years ago

Thanks for the reply@davidcaron, the file which I uploaded above doesn't have red color. So, how to know a file follows las standard ?

niranjanreddy891 commented 6 years ago

Also, what if the file has only orange color. See this file 305500_5750500.zip How to handle this type of files? I am curious to know about it. :)

davidcaron commented 6 years ago

the file which I uploaded above doesn't have red color

The file doesn't have any color. If you try to read its colors, it's normal that you get an error.

Also, what if the file has only orange color. See this file

The possible colors are red, green and blue. Also, this other file doesn't have any color either.

niranjanreddy891 commented 6 years ago

@davidcaron, how to know if a file follows las standard or not?