Forum

Author Topic: Imported point cloud incomplete  (Read 2112 times)

marcel.d

  • Newbie
  • *
  • Posts: 22
    • View Profile
Imported point cloud incomplete
« on: May 21, 2024, 12:30:41 PM »
Hello,

As part of a workflow we need to import very small point clouds into Metashape (10-100 points). The clouds are in the same projected crs as the rest of the project.

A) When importing a LAZ with 10 points, only 8 are shown in Metashape.

This is what the doc.xml file for the dense_cloud shows:

Code: [Select]
      <totalCount>10</totalCount>
      <validCount>8</validCount>

Here is the original point cloud (left) next to the point cloud exported from metashape (right):



You can see that 2 points in the lower left corner are missing.

It gets weirder:

B) When converting the LAZ to OBJ before importing, also 8 points are imported, but one of them is different from A.

C) Also, when pretending that local coordinates are used, 9/10 points are imported, but of course at a very wrong location.

D) When importing the points in the .pts format, 9/10 points are imported (again different from the ones in C).

E) LAS leads to the same results as LAZ. I did not try the PLY or E57 file formats.

I tried varying the number of neighbors used for normals calcuation but, "0", "1" and the default "28" all led to the same results.

I really need all 10 points. What can I do?

Thanks,
Marcel

marcel.d

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Imported point cloud incomplete
« Reply #1 on: May 22, 2024, 11:50:16 AM »
Hey again,

So far I have not found a satisfactory solution, so please let me know your thoughts.

What I have as of now is a workaround:

Add 4 points to the point cloud and place them ~1km away from the actual points in the corners of a rectangle containing all the relevant points. Then import the cloud normally.

Metashape still removes 1-2 points upon import, but luckily they are one of the external (extra) points. Manually delete the other extra points.

This is by no means a reliable way of doing what we need, but at least we learn that the geometry of the imported cloud influences the "selection" of the valid points that are kept.

If there is a way of telling Metashape to treat all imported points as "valid", please let me know of it because it would solve our issue.

Thanks,
Marcel

vineg

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Imported point cloud incomplete
« Reply #2 on: May 22, 2024, 12:29:13 PM »
Hi, Marcel!

As a temporary solution you can restore missing points after import, using "Restore Point Cloud..." command from "Tools" menu, "Point Cloud" section.

Regards, Egor

marcel.d

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Imported point cloud incomplete
« Reply #3 on: May 22, 2024, 03:59:12 PM »
Hi Egor,

Thank you very much!

Your workaround seems to work well and is a lot more reliable than my method of adding extra points outside the ROI.

Here is the code in case anyone has the same problem:

Code: [Select]
chunk.importPointCloud(
    path=str(cloud_path),
    format=Metashape.PointCloudFormat.PointCloudFormatLAZ,
    crs=chunk.crs,
    precision=0.001,
    calculate_normals=False,
)
new_cloud = chunk.point_cloud
new_cloud.restorePoints()
doc.save()

Kind regards,
Marcel