HomeForum Home → Software → Development → Thread

   

Calibration for the MLX (Fisheye)

Rank

Total Posts: 2

Joined 2015-04-09

PM

Hi,

We’re trying to find the calibration parameters of the MLX in fish-eye (distorted / not-undistorted) mode, but are having some trouble with this. The reason for this is that we want to run our own undistortion + rectification to do sparse stereo for visual odometry / SLAM, and we want to avoid discarding any pixels. So the idea is that we would use the undistorted image *with* the black bands as the starting point, not the nice remapped image that does not have these black bands. It would be great if the provided calibration software could give us these parameters!

But we run into a few problems:
- the parameters are not really specificed in the documentation,
- running the calibration software with undistortion off never seems to give a valid result.
This is elaborated below:

On the page https://duo3d.com/docs/articles/api#ParameterValues/Structures these functions are mentioned:

bool GetDUOIntrinsics(DUOInstance duo, INTRINSICS *val);
bool GetDUOExtrinsics(DUOInstance duo, EXTRINSICS *val);
And these map to these internal functions:

#define GetDUOIntrinsics(duo, val)      __DUOParamGet__(duo, DUO_INRINSICS, (void*)val)
#define GetDUOExtrinsics(duo, val)      __DUOParamGet__(duo, DUO_EXTRINSICS, (void*)val)

(should be DUO_INTRINSICS by the way, there is a typo in the constant’s name)

But I cannot find the exact definition of the values that will be filled in the ‘val’ parameter anywhere in the SDK. There are these structures

typedef struct
{
  unsigned short w, h;
  double left[12];
  double right[12];
}INTRINSICS;

typedef struct
{
  double rotation[9];
  double translation[3];
}EXTRINSICS;

.. and for the EXTRINSICS this is reasonably clear -> the 9 values for rotation are probably the elements of a 3x3 rotation matrix, although it would be good to know if we are talking about row vectors or column vectors, and whether the elements are stored with row-major or column-major indexing?

But for the INTRINSICS this is more opaque: what is the meaning of the 12 values? I assume these are the values in the same order as what the calibration software displays, as below. Is this correct?

[DUOR] Final reprojection error: 0.583137 pixels
[DUOR] Camera Parameters:
Model: PINHOLE
Image Size: 752, 480
Distortion Parameters:
k1: 2.52401
k2: -0.748726
k3: -0.176894
k4: 2.96409
k5: 0.248011
k6: -0.648647
p1: -0.00116063
p2: 7.19817e-005
Projection Parameters:
fx: 383.935
fy: 384.16
cx: 360.355
cy: 258.04

Final question: I have not been able to create a calibration while undistortion is off (I suppose the FISHEYE parameter would have to be passed to OpenCV, while the calibration program always attempts ‘PINHOLE’ ?), but at the same time it *is* possible to use the Dense3D application with undistortion off (so you guys have managed to create a calibration, correct?).

So can you tell us if it is possible to calibrate with undistortion off or not?

Edit: correction.. I misremembered something. There is no ‘FISHEYE’ parameter, I was referring to the ‘RATIONAL’ option as mentioned in Answer 1 in this post on OpenCV Answers: http://answers.opencv.org/question/6332/lens-distortion-equation-changed-reference-please/ Havin.g said that, the new ‘fisheye’ class in OpenCV 3 is probably a better match for what we want to do. Perhaps this is worth considering for you guys too.

Thanks a lot,
Lex

     
Avatar
RankRank

Total Posts: 37

Joined 2012-06-10

PM

Hi Lex,

Please take a look at the new SDK Documantation (v1.0.50.26) here: https://duo3d.com/docs/articles/api#ParameterValues/Structures
We listened to your feedback and produced well defined parameters that we included in the DUO SDK.
We have also added a new structure ‘DUO_STEREO’ that provides OpenCV compatible camera matrices that you can directly use.