colmap / glomap

GLOMAP - Global Structured-from-Motion Revisited
BSD 3-Clause "New" or "Revised" License
1.3k stars 77 forks source link

[QUESTION] Detected camera types more than reality. #30

Closed ichsan2895 closed 1 month ago

ichsan2895 commented 1 month ago

Hello, there is a dataset called wayve that has 5 camera types with total 1000 images. Here is the dataset that I concerned

It already has processed colmap's poses and instrinsic. Here is cameras.bin

# Camera list with one line of data per camera:
#   CAMERA_ID, MODEL, WIDTH, HEIGHT, PARAMS[]
# Number of cameras: 5
10 OPENCV_FISHEYE 1920 1080 943.52269896975372 940.30779474361361 970.47547675516648 540.97039145901408 -0.012557840449801991 -0.033048322739036511 0.041067527957576684 -0.01560882401539797
9 OPENCV_FISHEYE 1920 1080 904.07183964084277 919.36336174798021 927.83811857622675 554.02440192801316 0.013253850100268727 -0.041866095271345875 0.045384296297246864 -0.01654660514377345
8 OPENCV_FISHEYE 1920 1080 945.76089902486922 938.02872961770038 943.16021364280459 541.19790458372404 -0.027272058345406188 0.0062243721691585931 0.0025747723317551198 -0.0027478737587189701
1 OPENCV_FISHEYE 1920 1080 1607.8224767268289 1605.6720193282838 950.06322110545625 532.14085096810504 -0.026879582395269497 0.17615572980440725 -0.48427871506845432 0.34801469711296695
7 OPENCV_FISHEYE 1920 1080 908.27102165777819 905.47258834175568 961.77287911717588 552.88281117941824 -0.0055187400236421909 -0.004809028940045092 0.0061212722781081603 -0.0026949126171779908

Then I rerun the exact dataset with glomap. But, it has multiple cameras.

colmap feature_extractor \
    --image_path    scene_001/images/ \
    --database_path scene_001_glomap/distorted/database.db

colmap sequential_matcher \
    --database_path scene_001_glomap/distorted/database.db 

glomap mapper --database_path scene_001_glomap/distorted/database.db \
    --image_path scene_001/images/ \
    --output_path scene_001_glomap/distorted

colmap image_undistorter \
  --image_path scene_001/images \
  --input_path scene_001_glomap/distorted/0 \
  --output_path scene_001_glomap

Here is the cameras.bin

# Camera list with one line of data per camera:
#   CAMERA_ID, MODEL, WIDTH, HEIGHT, PARAMS[]
# Number of cameras: 1000
785 PINHOLE 1851 1040 15236.77176687543 15236.77176687543 925.5 520
244 PINHOLE 1934 1081 4070.0260849583292 4070.0260849583292 967 540.5
786 PINHOLE 384 216 1386.2327411663164 1386.2327411663164 192 108
so on until 1000 cameras listed here

What should I do, so I get only 5 cameras?

It already discussed here, its really slow if the camera intrinsic of each images needs to be estimated with the View Graph Calibration component

lpanaf commented 1 month ago

for this, you would need to specify directly to colmap in the feature_extraction step about the camera id. Or, you can write an external program to manually change the camera id after feature_extractor if this info is known

ichsan2895 commented 1 month ago

for this, you would need to specify directly to colmap in the feature_extraction step about the camera id. Or, you can write an external program to manually change the camera id after feature_extractor if this info is known

Hello, I found another ways that seems better. I differentiate the camera type by separating the folder inside ./path/to/scene/images. So each folder has images which has same type of cameras. Then I run this command:

colmap feature_extractor \
    --image_path    ./path/to/scene/images \
    --database_path ./path/to/scene/database.db \
    --ImageReader.single_camera_per_folder 1

If I found any problem, please let me reopen this thread. Thank you