pycolmap
pycolmap copied to clipboard
Usage according to README gives unlikely results of reprojection error
Hi,
Thanks for maintaining the package.
I'm trying to analyse the reprojection error of a simple SFM project (the south-building), but the calculated reprojection error are way too large to be true (1000+ pixels)
Is there a possible erronous usage? Code snippet is below, thanks.
import numpy as np
import pycolmap
sfm = pycolmap.Reconstruction('south-building/colmap/sparse')
for id, pt3d in sfm.points3D.items():
for track in pt3d.track.elements:
img = sfm.images[track.image_id]
cam = sfm.cameras[img.camera_id]
pt2d = img.points2D[track.point2D_idx]
assert pt2d.point3D_id == id
pt2d_ = cam.world_to_image(img.project(pt3d.xyz))
rpjerr = np.linalg.norm(pt2d.xy - pt2d_)
print(rpjerr)
The code looks OK. Does the reconstruction look good in the COLMAP GUI?
The reconstruction looks correct, it's done using automatic reconstruction on the demo south building.
I tested this on a local reconstruction and it's working fine (low reprojection errors). Could you provide the sparse folder such that we can reproduce the issue?