how to provide a hint to bundle adjustment?

1,022 views
Skip to first unread message

fbr...@gmail.com

unread,
Nov 2, 2016, 8:22:35 PM11/2/16
to COLMAP
I am trying to run COLMAP using data from an array of cameras that point outward. When I put my dataset into COLMAP, the bundle adjuster finds a plausible solution for the positions of the cameras, but their orientations are all backward (pointing in toward the center of the camera array, as opposed to pointing out). I am wondering if it is possible to give COLMAP a hint, since I have some prior knowledge about the position and orientation of each camera.

Here's what I tried so far-
(1) run on the dataset, get bad inward-pointing results.
(2) export the model
(3) modify the images.txt file that is produced to insert my own known information about the cameras, i.e. I generated the quaternions and translation vectors that are expected (see below for the full contents of my images.txt)

(4) import the model with the modified images.txt

The results don't come out as expected (see the image below). It makes the positions of all of the cameras the same, even though the translation vectors that I specified are not all the same:

Here is the contents of my images.txt:

# Image list with two lines of data per image:
#   IMAGE_ID, QW, QX, QY, QZ, TX, TY, TZ, CAMERA_ID, NAME
#   POINTS2D[] as (X, Y, POINT3D_ID)
# Number of images: 17, mean observations per image: 1522.65
1 -6.12323e-17 -0.234538 0.972107 0 0 0 17.2542 1 cam0.png
0 0 0
2 0.39493 0.772972 -0.472317 -0.153171 10.5181 8.0391 11.0642 1 cam1.png
0 0 0
3 -0.201137 0.894798 -0.141933 -0.372471 10.5181 -8.0391 11.0642 1 cam2.png
0 0 0
4 0.353153 -0.0613965 0.90375 0.233984 -10.5181 -8.0391 11.0642 1 cam3.png
0 0 0
5 0.419366 0.444622 0.789282 -0.0589615 -10.5181 8.0391 11.0642 1 cam4.png
0 0 0
6 -0.320501 -0.440849 0.678292 -0.492799 0 16.4084 5.33146 1 cam5.png
0 0 0
7 0.568196 -0.782144 -0.206849 -0.15039 0 -16.4084 5.33146 1 cam6.png
0 0 0
8 0.0971143 -0.700406 -0.0971143 0.700406 17.2542 0 0 1 cam7.png
0 0 0
9 0.283254 0.647894 0.283254 0.647895 -17.2542 0 0 1 cam8.png
0 0 0
10 0.720707 0.279193 0.547298 -0.321087 -10.5181 13.0073 -4.22656 1 cam9.png
0 0 0
11 0.622873 0.140076 -0.598197 0.484323 10.5181 13.0073 -4.22656 1 cam10.png
0 0 0
12 0.547534 -0.0533124 -0.612095 -0.56807 10.5181 -13.0073 -4.22656 1 cam11.png
0 0 0
13 0.761071 -0.562678 0.246871 -0.207891 -10.5181 -13.0073 -4.22656 1 cam12.png
0 0 0
14 -0.126168 -0.0410969 -0.306426 0.942601 0 10.1422 -13.9573 1 cam13.png
0 0 0
15 -0.499188 -0.273358 0.16973 0.804536 10.5181 0 -13.6779 1 cam14.png
0 0 0
16 0.172985 -0.0563809 0.304006 0.935135 0 -10.1422 -13.9573 1 cam15.png
0 0 0
17 0.833966 0.152311 0.283468 0.448271 -10.5156 0 -13.6779 1 cam16.png
0 0 0

A second question: the format of images.txt is such that it has 2 lines per camera where the first line specifies the quaternion and translation, and the second line stores a list of 2d points. Here I hacked it by just specifying a single point (0, 0) with index 0 for each camera. Is there a better way to import a prior camera configuration without mixing that with the points (feature matches I assume)?

Thanks



Johannes Schönberger

unread,
Nov 22, 2016, 7:39:49 PM11/22/16
to COLMAP, fbr...@gmail.com
At the moment, it is not possible to specify prior information about the relative pose of cameras. However, I plan to add this feature sometime in the future. I will try to remember to notify you here, once I committed the feature to Github.

Best,
Johannes

gdm...@gmail.com

unread,
Oct 30, 2017, 5:45:33 PM10/30/17
to COLMAP
I've been noticing the same issue:  

I noticed that often if I take a set of photos along a 1D arc around a central axis (with the cameras facing outwards towards the content).  

The sparse reconstruction completes alright, but the solved arc path is inverted, and cameras that were not previously converging now appear to be converging in the solution.  Also the 3d point cloud data appears to be some inversion of the original as well.  I think it is finding a plausible (but wrong) solution.

I do have access to some rough apriori pose information that I could possibly use for initialization to avoid this error, but I don't know how to make use of it.  I was thinking to do something like the original poster did but now I see the results were not so good in that person's case.  Any suggestions on how to possibly proceed to work around this issue if I have some initial (rough) extrinsics to start with?

Gabriel

Johannes Schönberger

unread,
Nov 8, 2017, 7:51:39 AM11/8/17
to COLMAP
This is a degenerate case for SFM, especially if you don't know the intrinsics from an offline calibration. Self-calibration is degenerate, e.g., see "Critical Configurations For Radial Distortion Self-Calibration" by C. Wu.

gdm...@gmail.com

unread,
Nov 8, 2017, 12:57:10 PM11/8/17
to COLMAP
Thank you, this paper indeed seems describe the exact issue I was seeing.  I later found that if i initialize the focal length closer to the true value, things haven't failed since then.  I didn't initialize the distortion parameters as well, but this paper makes me think that might be a good idea if I notice the problem again.  Thank you for the help.

Thanks,
Gabriel
Reply all
Reply to author
Forward
0 new messages