Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLOC camera refinement(poses) of known camera parameters #372

Open
ashutoshmishra1014 opened this issue Feb 21, 2024 · 3 comments
Open

HLOC camera refinement(poses) of known camera parameters #372

ashutoshmishra1014 opened this issue Feb 21, 2024 · 3 comments

Comments

@ashutoshmishra1014
Copy link

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()

@sarlinpe
Copy link
Member

If you need to specify both intrinsics and extrinsics, then you can follow the following steps:

  1. Create an empty pycolmap.Reconstruction object with cameras and images but no 3D points.
  2. Run hloc.triangulation starting from this empty reconstruction as reference_model
  3. Optionally run pycolmap.bundle_adjustment to jointly refine the camera parameters and 3D points.

@ashutoshmishra1014
Copy link
Author

Thanks for your response. Where can I find pycolmap documentation to go through the API calls and method signatures?

@sarlinpe
Copy link
Member

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/")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants