Cloud is the form of ndarray data, and it is (720,1080,4) shape, but I found that there are some problems with this data, for example, some values are nan values, and some color values overflow, like this:
nan values correspond to pixels with no depth information (occlusions, flares, reflections, low confidence values, etc).
The fourth field is the color value in 32-bit format.
You must “read” it in the correct way, thus you must convert the float32 value to an array of four 8-bit values, the first is Blue, the second is Red, the third is Green, and the last is Alpha (transparency level).
You can for example use Numpy:
import numpy as np
def float32_to_uint8_array(float32_value):
"""Converts a float32 value to an array of 4 8bit values.
Args:
float32_value: A float32 value.
Returns:
An array of 4 8bit values.
"""
# Convert the float32 value to a uint32 value.
uint32_value = np.uint32(float32_value)
# Split the uint32 value into 4 8bit values.
uint8_values = np.unpackbits(uint32_value, axis=0)[::-1]
return uint8_values