urbste / MultiCol-SLAM

This repository contains a multi-fisheye camera SLAM. The underlying SLAM system is based on ORB-SLAM.
627 stars 221 forks source link

Intrinsic Camera Parameters Calibration Issue -- Initialization failed #18

Closed ardalanK closed 7 years ago

ardalanK commented 7 years ago

I am trying to calibrate a Gear 360 (only one 180 fisheye lens right now) and am using ImprovedOcamCalib as well. The calibration parameters are as follows:

%YAML:1.0

Camera Parameters. Adjust them!

Camera calibration parameters camera back

Camera.Iw: 640 Camera.Ih: 640

hyperparameters

Camera.nrpol: 6 Camera.nrinvpol: 3

forward polynomial f(\rho)

Camera.a0: -172.296104925459 Camera.a1: 0 Camera.a2: 0.00160105662555009 Camera.a3: -6.34303796841769e-06 Camera.a4: 6.56202451752210e-08 Camera.a5: -1.83867951781103e-10

backward polynomial rho(\theta)

Camera.pol0: 17.2540014422096 Camera.pol1: 80.6878056249852 Camera.pol2: 298.076583841793 Camera.pol3: 336.001425859136

affine matrix

Camera.c: 1.001231302713875 Camera.d: -4.098360811880249e-04 Camera.e: -3.266710888569786e-04

principal point

Camera.u0: 3.222578566035110e+02 Camera.v0: 3.181511158806330e+02

create a mirror mask for fisheye cameras

Camera.mirrorMask: 1

The forward poly is extracted from "ss", and the backward poly is extracted from "pol"...I am using 15 grayscale images, downscaled to 640x640 for calibration. The calibration checkerboard is 7x5 (29mm).

The strange thing is that the tracking can initialize with the sample calibration file (Fisheye0.yaml) that comes in the repository!!!

Any idea what I might be missing here? Just to emphasize: this is only for one of the lenses... I am trying to use a single camera for tracking and point cloud generation... I guess there is no point in using two lenses that are 180 degree back to back (<-->) with no overlap...

yulong314 commented 7 years ago

which mode do u run , debug or release? I found that the debug version cann't initialize properly for our fisheye device.

ardalanK commented 7 years ago

I assume it's running on release.... How would I be able to change it?

ardalanK commented 7 years ago

I ran it on Debug mode and still have the same problem... I think the calibration should be fine since I'm using ImproveOcamCalib and it reprojects the corners correctly...

When running MultiCol-SLAM, the feature matching looks correct and it looks like it can initialize and start tracking, BUT it doesn't!!!!

Please let me know if you have dealt with the same situation and have any insight.

urbste commented 7 years ago

In Debug mode the tracking will not work properly. This is due to the fact that multiple threads are used. If for example the matching thread is to slow, no new features will be created and the tracking will be lost. You could delay the tracking thread by inserting a sleep(500) or something like that in the tracking thread.

Everyone who has issues with the calibration files: Instead of launching the SLAM "out-of-the-box" try to create a small C++ project that isolates and debugs all of the involved functions (world2cam, cam2world, file importer, ...). Then you take a checkerboard image, estimate the absolute orientation (PnP) and reproject the object points to see if import, calibration values and so on work properly.

ardalanK commented 7 years ago

@urbste Thank you so very much for your response!!!