I'm working with a team on point clouds for autonomous NASA greenhouses in the Correll Robotics Laboratory at the University of Colorado Boulder. We're using Intel's PXC for its close-range precision, but having a problem visualizing RGB32 data in the Point Cloud Library (pointclouds.org).
I have written code to grab U,V,Z and color data and save it into a .pcd file format usable by the PCL. The depth data looks good! See attached image, color coded by depth. However, I'm struggling to understand the best way to process the RGB32 data. According to Intel's documentation, RGB32 data should be saved as BGRA on little endian machines. But my typical color values look like 2502986900 or 4294967295 (see fourth column in attached data file) - which means that I have non-zero (and non-constant) values for the A byte. Is this normal?
If not, maybe something is wrong with my color grabbing code:
- colorSample->AcquireAccess(PXCImage::ACCESS_READ,PXCImage::COLOR_FORMAT_RGB32, &cdata); // save color data to &cdata
- pxcU32 *RGB = (pxcU32 *)cdata.planes; // get pointer to color plane
- get color value from RGB[i]; // i is the index of a point with good depth data, so random values like RGB, RGB, ..., are saved
If my code is fine and this is normal, then it is possible that I can fix what may just be a visualization issue by changing that dynamic A byte to 0, and thus ensure that I have no values larger than 16777215 (0x00FFFFFF).
Hope this is an easy fix - thanks for your help!