3DOM-FBK/deep-image-matching

Small question about camera model (multi focal length)

Opened this issue · 4 comments

Hi, thanks for the great support for multi focal length, it works fine.
And I have some small questions about camera model part.

  1. Why does model simple-radial set default value K1=0.1?
    Meanwhile, model opencv sets default value K1=K2=0.
    https://github.com/3DOM-FBK/deep-image-matching/blob/master/src/deep_image_matching/io/h5_to_db.py#L159

  2. Manually editing cameras.yaml makes users can set everything, but it is not a easy usage when calculating large image set (>hundreds).
    Now I have written a small program to scan the file names in a folder.
    So my actually process is: 1. Put different focal length images in seperated sub-folders. 2. Run the scan program to get the file names in every sub-folders. 3. Move all the images in sub-folders to the images folder. 4. Edit cameras.yaml to fill in the file names.
    If ImageMatching class could scan sub-folders, it will be no need to do these steps. This makes all the images use a same camera model, which is not so flexible, but we can change it using COLMAP UI later.
    Of course, this is not a functional question, just for easy using for large data set.

Thank you.

Hi, good to know that works fine!

  1. If you let pycolmap to refine distortion params, K1 is just an initial guess. No problem in keeping K1=0.1. In any case K1=0.0 is an usual choice, I will change it, thanks!
    In main.py you can choose to refine or not extra params which are distortion params
    if use_pycolmap:
        # import reconstruction module
        reconstruction = import_module("deep_image_matching.reconstruction")

        # Optional - You can specify some reconstruction configuration
        # reconst_opts = (
        #     {
        #         "ba_refine_focal_length": True,
        #         "ba_refine_principal_point": False,
        #         "ba_refine_extra_params": False,
        #     },
        # )
        reconst_opts = {}
  1. Yes using subfolders is for sure the best option. It needs a bit more work respect what we just did, we have to check no conflicts in the image paths, we planned to switch to this for the next release. So, for now yes, you have a bit more 'manual' work, let you know when it will available in dev. If you have time, feel free to make the needed changes and push them in dev

Thanks for the feedback!

  1. If you let pycolmap to refine distortion params, K1 is just an initial guess. No problem in keeping K1=0.1. In any case K1=0.0 is an usual choice, I will change it, thanks!

I know it is an initial value, but sometimes large distortion initial value may cause fail to calculate camera position (especially when focal length is large).
And actually, I do not know how to give a 'good initial value'.
So when the calculation result is wrong, usually I would try to calibrate the camera using chessboard, and then using the calibration result as the initial value. Or just try and try.
I wonder whether is there a better way to get a initial value.
(Of course, maybe this is not this project's work, should be COLMAP or OpenMVG's.)

  1. Yes using subfolders is for sure the best option. It needs a bit more work respect what we just did, we have to check no conflicts in the image paths, we planned to switch to this for the next release. So, for now yes, you have a bit more 'manual' work, let you know when it will available in dev. If you have time, feel free to make the needed changes and push them in dev

Thanks for hearing your plan.
I could write C/C++ fast, but sadly I am not good at Python, even feel difficult to understand the code.
Please just take your time to add subfolders, it is not much important. The multi focal length function is working well now. And subfolders is the icing on the cake. : )

Are you working on photogrammetric applications or SLAM sequences? If the camera network is good enough you should not have problems with self-calibration. In any case you can always acquire a specific image sequence for the calibration and eventually keeping fix the internal parameters later. Maybe are you using a fisheye?

Ok I will put label enhancement for this issue

Are you working on photogrammetric applications or SLAM sequences? If the camera network is good enough you should not have problems with self-calibration. In any case you can always acquire a specific image sequence for the calibration and eventually keeping fix the internal parameters later. Maybe are you using a fisheye?

Ok I will put label enhancement for this issue

Photogrammetric applications.
When images overlap is not enough, it is difficult to calculation the position.
So sometimes I just take some wide-angle images to help the location. And usually wide-angle images (~ or > 100 degree, OpenCV fisheye model usually has a better result than pinhole) have a larger distortion than normal using images. And they are more sensitive when using COLMAP to optimize the intrinsics. If distortion initial value is not near the true value, position calculation usually fail or has few images.