Open ashutoshmishra1014 opened 4 months ago
If you need to specify both intrinsics and extrinsics, then you can follow the following steps:
pycolmap.Reconstruction
object with cameras and images but no 3D points. hloc.triangulation
starting from this empty reconstruction as reference_model
pycolmap.bundle_adjustment
to jointly refine the camera parameters and 3D points.Thanks for your response. Where can I find pycolmap documentation to go through the API calls and method signatures?
There is no documentation. Use help(pycolmap)
and check examples in the README. Example:
rec = pycolmap.Reconstruction()
camera_id = 1 # increment for each new camera
cam1 = pycolmap.Camera(model='PINHOLE', width=w, height=h, params=params, camera_id=camera_id)
rec.add_camera(cam1)
image_id = 1 # increment for each new image
cam_from_world = pycolmap.Rigid3d(pycolmap.Rotation3d(qvec), tvec)
im1 = pycolmap.Image(image_name, [], cam_from_world, camera_id, image_id)
rec.add_image(im1)
rec.write("path/")
There is no documentation. Use
help(pycolmap)
and check examples in the README. Example:rec = pycolmap.Reconstruction() camera_id = 1 # increment for each new camera cam1 = pycolmap.Camera(model='PINHOLE', width=w, height=h, params=params, camera_id=camera_id) rec.add_camera(cam1) image_id = 1 # increment for each new image cam_from_world = pycolmap.Rigid3d(pycolmap.Rotation3d(qvec), tvec) im1 = pycolmap.Image(image_name, [], cam_from_world, camera_id, image_id) rec.add_image(im1) rec.write("path/")
That won't work. When we manually add images, they come unregistered, which won't be saved. source
We need to set its registered property to True before adding it to the reconstruction.
im1.registered = True
I want to use already known camera parameters(intrinsics+extrinsics) and refine it using HLOC. Could you please guide how to achieve that using the right APIs?
From the documentation it is clear how to specify already known intrinsic and do the refinement during reconstruction but it is not yet clear if one could also specify the extrinsics for each image or not?
It is also not clear how to specify individual intrinsics with the call to
reconstruction.main()