0

Description of the problem:

When cropping a .ply point cloud using PDAL pipeline:

    {
      "pipeline":[
        "input.ply",
        {
          "type":"filters.crop",
          "bounds":"([52435.72, 63951.79], [53477.36, 58371.35])" 
        },
        {
          "type":"writers.ply",
          "filename":"output.ply"
        }
      ]
    }

it also "strips" the point cloud.
Here are some screenshots from CloudCompare:

PDAL Cropped cloud view from above (xy plane) Fig. 1 PDAL Cropped cloud view from above (xy plane).

PDAL Cropped cloud view from front (xz plane) Fig. 2 PDAL Cropped cloud view from front (xz plane).

Original point cloud view from front (xz plane). Exact same viewing position and orientation as the second image above. The original point cloud is denser and more homogeneous. Fig. 3 Original point cloud view from front (xz plane). Exact same viewing position and orientation as the second image above. The original point cloud is denser and more homogeneous.

1

Explanation:

When not specified, it's the ASCII format that is used by the PLY writer. This impacts the precision of the points.

Header of the original CloudCompare point cloud:

$ head -n16 input.ply
ply
format binary_little_endian 1.0
comment Created by CloudCompare v2.10-alpha
comment Created 03.08.18 14:45
obj_info Generated by CloudCompare!
element vertex 8848475
property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
property float nx
property float ny
property float nz
end_header

Header of the PDAL clipped cloud:

$ head -n14 output.ply
ply
format ascii 1.0
comment Generated by PDAL
element vertex 2850721
property float64 x
property float64 y
property float64 z
property uint8 red
property uint8 green
property uint8 blue
property float32 normalx
property float32 normaly
property float32 normalz
end_header

Solution:

Writing a binary file by adding "storage_mode":"little endian", in the pipeline:

{
  "pipeline":[
    "input.ply",
    {
      "type":"filters.crop",
      "bounds":"([52435.72, 63951.79], [53477.36, 58371.35])" 
    },
    {
      "type":"writers.ply",
      "storage_mode":"little endian",
      "filename":"output.ply"
    }
  ]
}

solves the issue.

Remark:

Please also notice that normals' names from a PDAL cloud are not automatically recognized as such by CloudCompare (they are called normalx, normaly and normalz and CC is waiting for Nx, Ny and Nz); therefore one has to select them manually from the ComboBox when importing the clipped cloud in CC.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.