Agisoft Metashape > Python and Java API

exportPoints() deletes cloud

(1/1)

forumname:
I have a cloud that I would like to export:

frame.dense_cloud
<DenseCloud '3354 points'>

When I call exportPoints(), it outputs an empty file and then deletes the points from frame.

frame.exportPoints('f0.xyz', binary=False, format=Ms.PointsFormatXYZ)
ExportPoints: binary = off, format = PointsFormatXYZ, path = f0.xyz
point cloud size: 0 points

When I check the dense cloud again, the points are now deleted.

frame.dense_cloud
<DenseCloud '0 points'>

How do I export a cloud?


Alexey Pasumansky:
Hello forumname,

I am not observing such behavior on random project with the dense point cloud.

Please specify, which Metashape version you are using and whether you observe similar behavior if you try to export point using application GUI?

forumname:
Version 1.7.2 build 12070 (64 bit) on Linux Ubuntu.

Exporting through GUI is fine.

The above problem was encountered running through Spyder IDE. Running the script from Metashape also deletes the point cloud.


import Metashape as Ms

doc = Ms.Document()

doc.open('./F2.psx')

chunk = doc.chunk


for frame in chunk.frames:
    frame.matchPhotos(downscale=1)

chunk.alignCameras( adaptive_fitting=True )


for frame in chunk.frames:
    frame.buildDepthMaps( downscale = 8, max_neighbors = 5 )

region = chunk.region
region.size = 1.5 * region.size
chunk.region = region


for frame in chunk.frames:
    frame.buildDenseCloud( keep_depth = True,
                          point_confidence = True,
                          max_neighbors = 5 )

    frame.exportPoints('f0.xyz', binary=True, format=Ms.PointsFormatXYZ)

Alexey Pasumansky:
Hello forumname,

Does it help, if you add the following line to the final loop before the export line:

--- Code: ---doc.save()
--- End code ---

forumname:
Solved, thank you.

Navigation

[0] Message Index

Go to full version