-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange color behavior when saving .PCD file and loading it again. from [PCL-users] #1543
Comments
Thanks for the complete test code! Your input PCD file doesn't seem to be corrupted, I used |
I'll report test results. Maybe, This issue seems to occur only when using |
I was able to reproduce it as well. I'm looking into this now. |
The issue is related to our float representation of color. As you know, color is stored in 32bits, sometimes as float with the member name ' rgb' sometimes as a unit32_t with member name 'rgba' . The color information is packed as
Now according to the IEEE 754 NaN definition, if your first 9 bits are set to 1s, then the value is parsed as a NaN. When we use the type PointXYZRGB and we get the fields for the pointcloud, it's inferring we have an rgb field of float type. When we then later do the pcl::is_nan check, everything in this format
get's interpreted as nan. I gotta admit, fixing this one requires some Boost MPL kung fu skill, I'm not really sure I have at the moment 😄, but let's see... |
What about #1385 ? |
It will solve the issue. I really feel we should simply register all point types that have color with uint32_t rgba, and I tried it, but it opened even bigger problems 😄 |
Should be fixed by #1385, reopen if it is not. |
I had this same issue today. So it's not solved? Any workaround? |
Are you using 1.8.1 or master? |
I'm actually using pcl_ros... I guess it is 1.7, but I'm not sure. I needed to save the pointcloud from a topic. I guess it might easier to convert to XYZGRBA ? |
Yes, convert to a point type with RGBA color, then saving will be done in
uint32 no matter which PCL version you use.
…On Thu, 24 May 2018, 17:14 Dhiego Magalhães, ***@***.***> wrote:
I'm actually using pcl_ros <http://wiki.ros.org/pcl_ros#pointcloud_to_pcd>...
I guess it is 1.7, but I'm not sure. I needed to save the pointcloud from a
topic. I guess it might easier to convert to XYZGRBA ?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1543 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABLyiIht8lAbntj7byTrtdGxVhkgv6q1ks5t1yLBgaJpZM4HdswP>
.
|
ref: http://www.pcl-users.org/Strange-color-behavior-when-saving-PCD-file-and-loading-it-again-td4040975.html
I was able to reproduce this with my PCD file (captured by Kinect v2) locally, so I filed this issue here.
A sample code and pcd file can be found at https://github.com/r9y9/pcdio_test.
Orignal point cloud captured by kinect v2:
Saving and loading it again then:
This strange behavior only happens when saving PCD file as ASCII (no problem in binary mode). I'm testing with PCL trunk on osx 10.10.4.
The text was updated successfully, but these errors were encountered: