Drawback: keeps the entire reconstruction object in memory until any Python reference to any child object image/camera/point3D is deleted.
Minimal example:
import pycolmap
import numpy as np
import gc
reconstruction = pycolmap.Reconstruction()
i = reconstruction.add_point3D(
xyz=np.array([0, 0, 0]),
color=np.array([0, 0, 0], dtype=np.uint8),
track=pycolmap.Track(),
)
p = reconstruction.points3D[i]
print(p.summary())
del reconstruction
gc.collect()
# allocate most of the memory to a new object
x = np.random.rand(3000,10000,100)
assert np.all(p.color == np.zeros(3))
Fixes https://github.com/colmap/pycolmap/issues/212
Drawback: keeps the entire reconstruction object in memory until any Python reference to any child object image/camera/point3D is deleted.
Minimal example: