Skip to content
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

RGB values are set in point correctly but are not read back. #19

Closed
MartenBroekens opened this issue Dec 13, 2022 · 1 comment
Closed

Comments

@MartenBroekens
Copy link

MartenBroekens commented Dec 13, 2022

Hi, I am trying to store RGB point values in a every point of a large point cloud using the writer. I verified that the rgb values are in the point but when I read the point back the RGB values are zero. I tried both 8 and 16 bit rgb values and with the classification value at 2 as touched upon in issue #9 . What I do in the code to save rgb is the following. p.R, p.G, p.B are 8-bit RGB values in bytes respectively:

laszip_point point = new laszip_point();
point.rgb[0] = Convert.ToUInt16(p.R * 256);
point.rgb[1] = Convert.ToUInt16(p.G * 256);
point.rgb[2] = Convert.ToUInt16(p.B * 256);
var err = m_LasWriter.laszip_set_point(point);
err = m_LasWriter.laszip_write_point();

@MartenBroekens
Copy link
Author

I found the issue m_LasWriter.header.point_data_format needs to be set to 2 for rgb signals and 3 for rgb signals plus gps time data for the data to be saved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant