Intrinsic Matrix From Calibration Not Matching Documentation

asked 2015-04-30 10:34:54 -0600

jpistorino gravatar image

updated 2015-04-30 20:53:35 -0600

I am trying to calibrate a Logitech c930 HD (1920 x 1080) camera and am getting an intrinsic matrix that does not appear to match what the documentation says I should have.

As I understand http://docs.opencv.org/modules/calib3... and http://docs.opencv.org/doc/tutorials/... the intrinsic matrix should look like this:

image description

However, the matrix I am getting out of the calibration functions looks like this:

3397.61      0             0

0                3160.85   0

961.02       612.61     1

That matrix appears to be the transpose of the matrix from the documentation. Is it me or the docs that are wrong?

Also, I am getting an RMS and totalAvgErr of 0.1864 and am wondering if all of these numbers are sounding right.

Here is a short code segment where I print out the matrix in a WinForms app.

DrawLabelABS(this->labelCamera0IntRows,tintrinsic.rows.ToString("D"));
DrawLabelABS(this->labelCamera0IntCols,tintrinsic.cols.ToString("D"));
if((tintrinsic.rows == CALIBRATE_INTRINSIC_ROWS) && (tintrinsic.cols == CALIBRATE_INTRINSIC_COLS))
{
    DrawLabelABS(this->labelCamera0Int00,tintrinsic.at<double>(0,0).ToString("F2"));
            DrawLabelABS(this->labelCamera0Int01,tintrinsic.at<double>(0,1).ToString("F2"));
    DrawLabelABS(this->labelCamera0Int02,tintrinsic.at<double>(0,2).ToString("F2"));
    DrawLabelABS(this->labelCamera0Int10,tintrinsic.at<double>(1,0).ToString("F2"));
        DrawLabelABS(this->labelCamera0Int11,tintrinsic.at<double>(1,1).ToString("F2"));
    DrawLabelABS(this->labelCamera0Int12,tintrinsic.at<double>(1,2).ToString("F2"));
    DrawLabelABS(this->labelCamera0Int20,tintrinsic.at<double>(2,0).ToString("F2"));
    DrawLabelABS(this->labelCamera0Int21,tintrinsic.at<double>(2,1).ToString("F2"));
    DrawLabelABS(this->labelCamera0Int22,tintrinsic.at<double>(2,2).ToString("F2"));
}

Any help appreciated. Thanks

edit retag flag offensive close merge delete

Comments

How do you calibrate the camera a print the matrix? It looks transposed, so maybe your output is wrong. A function that is as basic as this one is most probably correctly documented.

FooBar gravatar imageFooBar ( 2015-04-30 12:41:57 -0600 )edit

I just edited the question to show a code segment. It seems pretty clear that the code is correct, even though you cannot see the screen layout. If you consider the row that has 2,0; 2,1; 2,2 that row has a 1 in it where it should be but also has two other values that should not be there according to the docs.

jpistorino gravatar imagejpistorino ( 2015-04-30 22:43:03 -0600 )edit