deep-image-matching icon indicating copy to clipboard operation
deep-image-matching copied to clipboard

Multi-camera configuration issues

Open Anqi00 opened this issue 4 months ago • 5 comments

Here's my camera configuration file. general: camera_model: "opencv" single_camera: false

cam0: camera_model: "opencv" images: "*.JPG" # DJI

cam1: camera_model: "opencv" images: "*.png" # Azure

The warning I encountered during operation is: 2025-08-28 20:47:35 | [WARNING] Was not possible to load the first image to initialize cam0 2025-08-28 20:47:35 | [WARNING] Was not possible to load the first image to initialize cam1

Anqi00 avatar Aug 28 '25 11:08 Anqi00

Hi, I've done some tests, the error you got is because you are missing the declaration of intrinsics. See example below:

general:
  camera_model: "pinhole" # ["simple-pinhole", "pinhole", "simple-radial", "opencv"]
  openmvg_camera_model: "pinhole" # ["pinhole", "pinhole_radial_k3", "pinhole_brown_t2"]
  single_camera: True
  intrinsics: [
    1200, 1200, 750, 500
  ]  

cam0:
  camera_model: "pinhole"
  intrinsics: [
    1200, 1200, 500, 750
  ]
  images : "*.JPG"


# cam1:
#   camera_model: "pinhole"
#   intrinsics: [
#     1200, 1200, 750, 500
#   ]  
#   images : "DSC_6468.JPG"

lcmrl avatar Aug 28 '25 15:08 lcmrl

general: single_camera: false camera_model: "opencv"

cam0: # DJI camera_model: "opencv" images: "*.JPG" intrinsics: [ 3579.456082, 3603.515921, 2644.189243, 2167.575739, 0.059049, -0.162987, 0.024601, 0.002016 ]

cam1: # Azure camera_model: "opencv" images: "*.png" intrinsics: [ 894.637116, 894.415775, 943.383850, 563.671383, 0.078929, -0.045787, 0.003979, -0.002581 ]

2025-08-29 10:37:50 | [WARNING ] Was not possible to load the first image to initialize cam0 2025-08-29 10:37:50 | [WARNING ] Was not possible to load the first image to initialize cam1 Even though I added the parameters, I still get this error. Do I need to update to version 2.0.0? I'm currently using 1.3.0.

Anqi00 avatar Aug 29 '25 01:08 Anqi00

Yes, if you are using an older version please declare one by one the images, something like:

images: "image1.JPG,image2.JPG,image3.JPG"

lcmrl avatar Aug 29 '25 09:08 lcmrl

Thank you for your reply; your work is truly valuable. This issue has been resolved with version 2.0.0. However, in version 1.3.0, the configuration file I set is: general: camera_model: "opencv" single_camera: false

cam0: camera_model: "opencv" intrinsics: [ 83579.456082, 3603.515921, 2644.189243, 2167.575739, 0.059049, -0.162987, 0.024601, 0.002016 ] images: "p1.JPG, p2.JPG, p3.JPG, p4.JPG, p5.JPG, p6.JPG, p7.JPG, p8.JPG"

cam1: camera_model: "opencv" intrinsics: [ 894.637116, 894.415775, 943.383850, 563.671383, 0.078929, -0.045787, 0.003979, -0.002581

images: "azure.png"

And then ran the command: python main.py --dir assets/orchard --images assets/orchard/images --pipeline superpoint+lightglue --camera_options config/my_cameras.yaml --tiling preselection

Although there was no warning like "[WARNING] Was not possible to load the first image to initialize cam1," the resulting camera.txt file contained the following: "# Camera list with one line of data per camera:

CAMERA_ID, MODEL, WIDTH, HEIGHT, PARAMS[]

Number of cameras: 9

1 OPENCV 5280 3956 3709.9149163901179 3730.3676521123584 2640 1978 -0.096869524646643862 -0.014690090878571005 -0.00084528338428306615 -0.0030464481046677868 2 OPENCV 1920 1080 914.08787246221891 913.9380732516596 960 540 0.095401937891426813 -0.046256662667200903 -0.0089572352585077127 -0.003558375743834961 3 OPENCV 5280 3956 3738.7765246838453 3760.4043176006053 2640 1978 -0.10486284970653663 -0.0047345729932409203 -0.00089675466978785467 -0.0025515144382358521 4 OPENCV 5280 3956 3713.6397003182387 3749.2605987764364 2640 1978 -0.10051204407439228 -0.01316862278158857 0.00027127201194416753 -0.0015087345285849962 5 OPENCV 5280 3956 3724.2522753490716 3752.1290311790685 2640 1978 -0.099117000779811476 -0.014651630392955403 -6.9446698891890499e-05 -0.0015543439836073801 6 OPENCV 5280 3956 16747.312894569812 16685.0414421403 2640 1978 -2.8394463086177995 -55.97217309485292 -0.12613568037266096 -0.39453076277208948 7 OPENCV 5280 3956 3744.8637240880194 3764.388421501933 2640 1978 -0.093493562743066097 -0.023343597012469137 -3.0686213126526922e-05 0.0010210531350492234 8 OPENCV 5280 3956 3745.3419438768633 3766.9876836731873 2640 1978 -0.097439352708601837 -0.015734442906761556 -0.00027196118199017714 -0.0029805257919876455 9 OPENCV 5280 3956 3750.7497318617193 3770.1106109828047 2640 1978 -0.095170750299327631 -0.021517810817246071 -4.3612956994243062e-05 -0.0018405674592827579

Is this a fine-tuning of the parameters in the code, or was it not set successfully?

Anqi00 avatar Aug 29 '25 12:08 Anqi00

Hi, did you solve the problem? If the code is working in version 2.0, I would close the issue

lcmrl avatar Sep 26 '25 14:09 lcmrl