instant-ngp icon indicating copy to clipboard operation
instant-ngp copied to clipboard

--colmap_camera_params format

Open nemtiax opened this issue 2 years ago • 4 comments

I want to provide camera intrinsics to the script colmap2nerf.py, using the option --colmap_camera_params.

The help string says, Format: fx,fy,cx,cy,dist

https://github.com/NVlabs/instant-ngp/blob/51e4107edf48338e9ab0316d56a222e0adf87143/scripts/colmap2nerf.py#L33

However, this doesn't seem to work for me:

(ngp) C:\ngp\instant-ngp\drone_couch>python ..\scripts\colmap2nerf.py --colmap_matcher exhaustive --run_colmap --aabb_scale 16 --colmap_camera_params 410.89398,456.2263,366.95539,229.21969,0
running colmap with:
        db=colmap.db
        images="images"
        sparse=colmap_sparse
        text=colmap_text
warning! folders 'colmap_sparse' and 'colmap_text' will be deleted/replaced. continue? (Y/n)y
==== running: colmap feature_extractor --ImageReader.camera_model OPENCV --ImageReader.camera_params "410.89398,456.2263,366.95539,229.21969,0" --SiftExtraction.estimate_affine_shape=true --SiftExtraction.domain_size_pooling=true --ImageReader.single_camera 1 --database_path colmap.db --image_path "images"
456.2263 was unexpected at this time.
FATAL: command failed

Have I misunderstood how to format these?

nemtiax avatar Oct 12 '22 19:10 nemtiax

Did you ever make this work?

at82 avatar Mar 15 '23 20:03 at82

Please provide clarity in the docs!

juliusroschmann avatar May 09 '23 11:05 juliusroschmann

Not sure if this is the right way to do it or not. I was getting an CameraModelVerifyParams error. Here it shows different number of params for different camera models:

https://github.com/colmap/colmap/blob/1f69517d360463bf2e8936fdd1f1e61f719ea6eb/scripts/python/read_write_model.py#L54

So e.g. PINHOLE camera model 4 params (because the model is checked against its predefined number of params https://github.com/colmap/colmap/blob/main/src/colmap/sensor/models.cc#L220), would run for me.

python ../../scripts/colmap2nerf.py --video.mkv --video_fps 2 --colmap_camera_params=fx,fy,cx,cy --colmap_camera_model=PINHOLE --run_colmap --aabb_scale 4

ko-work avatar Aug 23 '23 09:08 ko-work

Bump on this thead

amballa avatar Dec 16 '23 11:12 amballa