Giter Site home page Giter Site logo

Comments (6)

sarlinpe avatar sarlinpe commented on July 20, 2024 3

Indeed, CameraMode defines how the cameras are shared across images and camera_model defines the type of camera (pinhole, radial, etc.) but the focal length is always inferred from the EXIF (image size + sensor specs) while the distortion parameters are initialized to zero.

To actually force a known camera, for now it is best to directly modify the database:

from hlco.utils.database import COLMAPDatabase
db = COLMAPDatabase.connect(database_path)
cam_id = 0
cam_tuple = (cam.model_id, cam.width, cam.height, tuple(cam.params))
db.add_camera(*cam_tuple, camera_id=cam_id)
for i, name in enumerate(sorted(image_list)):
    db.add_image(name, cam_id, image_id=i+1)
db.commit()
db.close()

We should instead bind ImageReaderOptions to have access to ImageReaderOptions.camera_params - you're welcome to submit a PR :)

from pycolmap.

Phil26AT avatar Phil26AT commented on July 20, 2024

Yes, you can set shared intrinsics with camera_mode=pycolmap.CameraMode.SINGLE in hloc reconstruction or in pycolmap.import_images.

With shared intrinsics, COLMAP uses one camera for all images, and the intrinsics will be adjusted jointly during bundle adjustment.

from pycolmap.

Zhu-Liyuan avatar Zhu-Liyuan commented on July 20, 2024

Thanks!

from pycolmap.

aunagar avatar aunagar commented on July 20, 2024

Regarding shared / per image intrinsic. I see that we can set CameraMode SINGLE or PER_IMAGE. But where do we pass the known intrinsics? I see the option of adding camera_model, but not the actual intrinsic parameters in insert_images function.

Is it possible to pass the intrinsic parameters? If yes, how? Or is there any other way to assign cameras to the added images?

Thanks!

from pycolmap.

zr19980402 avatar zr19980402 commented on July 20, 2024

As the known camera intrinsic, some details to consult.
Firstly, "cam_tuple = (cam.model_id....) " If we should define a camera structure before the code
Secondly, shoud the image_list be put into the hloc function (import_images)

below are the codes.
2

details!
import_images is the hloc function.

from pycolmap.

zr19980402 avatar zr19980402 commented on July 20, 2024

if you want to use fixed camera paremeters, you can download the pycolmap source codes.

  1. to change the images.cc you will find it use the colmap as the base. so you can change the ImageOption (class).
  2. rebuild pycolmap & holc.

from pycolmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.