Open abellgithub opened 4 months ago
Yes, I agree. There is a non standard pcd being created with the writers.pcd containing no rgb values. Even I try to tell the writers.pcd what type and order of output I need.
{ "type": "writers.pcd", "filename": "data/output.pcd", "compression": "ascii", "order": "X,Y,Z,Red,Green,Blue" },
Am I doing something wrong? But even opening it in Cloud Compare shows there is no RGB values.
Also open3d confirms that the colors are not contained as this test shows:
`import open3d as o3d import numpy as np
pcd = o3d.io.read_point_cloud(input_pcd) # Replace with the correct path to your PCD file
if not pcd.has_colors(): print("PCD file does not contain color information")
PCD file does not contain color information `
I usually do this:
{
"pipeline": [
{
"type": "readers.las",
"filename": "/workdir/${input_file}"
},
{
"type": "filters.assign",
"value": ["Red = Red / 256", "Green = Green / 256", "Blue = Blue / 256"]
},
{
"type": "filters.ferry",
"dimensions": "=> RGB"
},
{
"type": "filters.assign",
"value": "RGB = (Red * 65536 + Green * 256 + Blue)"
},
{
"type": "writers.pcd",
"filename": "/workdir/${output_file}",
"compression": "binary",
"order": "X=Double,Y=Double,Z=Double,RGB=Unsigned32,intensity=Unsigned16",
"keep_unspecified": "false"
}
]
}
You can also do the reverse transformation while reading the .pcd with ferry and assign. PDAL is quite powerful.
PCD contains special handling for Red, Green and Blue stored as a single entity. These may be stored as 4 byte floating or integral values. PDAL should parse the "rgb" field into Red, Green and Blue dimensions.
See: #2880