Calibration problems

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Calibration problems

mgfleming53202
I am trying to calibrate a single camera using a series of 10
chessboard images. When I did this with OpenCV and then used the
distortion coefficients to undistort images taken with the same
camera, I got gibberish. So, I took a closer look at the distortion
coefficients.

Here are my results from OpenCV:
Intrinsics: 1.14660566e+04 0.             2.04579358e+03
            0.             1.14588232e+04 1.51486438e+03
            0.             0.             1
Distortion: 0.41165924 -31.90976524 3.71374376e-03 -3.90885351e-03
744.66418457

Here is what I get with Bouguet's Matlab toolbox:
            11578.1        0.             2014.5
            0.             11570.6        1416.6
            0.             0.              1
Distortion:  0.11679   -2.76960   -0.00072   -0.00582  0.00000

I find it alarming that there is so little agreement between the two,
especially with respect to the distortion coefficients. OpenCV's
distortion coefficients look plain wrong. Any assistance would be much
appreciated. I'm new to OpenCV and am rapidly losing faith -- would
really appreciate some help in sorting this out.

Matthew Fleming

Reply | Threaded
Open this post in threaded view
|

Re: Calibration problems

Manikandan-3
I too had hell a lot of problems when i tried to do the
calibration.Re-check all your parameters once again and post your code
at http://pastebin.com/pastebin.php and give the link here...We can take
a look.

Best Regards,
Mani


--- In [hidden email], "mgfleming53202" <mfleming@...> wrote:

>
> I am trying to calibrate a single camera using a series of 10
> chessboard images. When I did this with OpenCV and then used the
> distortion coefficients to undistort images taken with the same
> camera, I got gibberish. So, I took a closer look at the distortion
> coefficients.
>
> Here are my results from OpenCV:
> Intrinsics: 1.14660566e+04 0.             2.04579358e+03
>             0.             1.14588232e+04 1.51486438e+03
>             0.             0.             1
> Distortion: 0.41165924 -31.90976524 3.71374376e-03 -3.90885351e-03
> 744.66418457
>
> Here is what I get with Bouguet's Matlab toolbox:
>             11578.1        0.             2014.5
>             0.             11570.6        1416.6
>             0.             0.              1
> Distortion:  0.11679   -2.76960   -0.00072   -0.00582  0.00000
>
> I find it alarming that there is so little agreement between the two,
> especially with respect to the distortion coefficients. OpenCV's
> distortion coefficients look plain wrong. Any assistance would be much
> appreciated. I'm new to OpenCV and am rapidly losing faith -- would
> really appreciate some help in sorting this out.
>
> Matthew Fleming
>


Reply | Threaded
Open this post in threaded view
|

Re: Calibration problems

mgfleming53202
Thank you very much for your willingness to look at this. The code
that I wrote originally was like this:

http://pastebin.com/m7bab9d9c

Then I also tried modifying the stereo_calib example that is
distributed with OpenCV, and ended up with this:

http://pastebin.com/d2f0bfe6e

I got the same bad result either way.

If you want to have a look at my calibration images, you can download
them from

www.dp.mcw.edu/palmImaging/calibration.tgz

There really seems to be something wrong with OpenCV's calibration
routines, at least with a planar target. I've now tried two sets of
images with the two sets of code referenced above, and in both cases
got unreasonable values for the distortion coeffs, which did not agree
with the distortion coeffs I got by running the same images through
Bouguet's Matlab toolbox. I'd be immensely grateful if someone could
tell me how to make this work.

TIA,

Matthew Fleming
Medical College of Wisconsin
mfleming at mcw.edu


--- In [hidden email], "Manikandan" <kid_royalenew@...> wrote:

>
> I too had hell a lot of problems when i tried to do the
> calibration.Re-check all your parameters once again and post your code
> at http://pastebin.com/pastebin.php and give the link here...We can take
> a look.
>
> Best Regards,
> Mani
>
>
> --- In [hidden email], "mgfleming53202" <mfleming@> wrote:
> >
> > I am trying to calibrate a single camera using a series of 10
> > chessboard images. When I did this with OpenCV and then used the
> > distortion coefficients to undistort images taken with the same
> > camera, I got gibberish. So, I took a closer look at the distortion
> > coefficients.
> >
> > Here are my results from OpenCV:
> > Intrinsics: 1.14660566e+04 0.             2.04579358e+03
> >             0.             1.14588232e+04 1.51486438e+03
> >             0.             0.             1
> > Distortion: 0.41165924 -31.90976524 3.71374376e-03 -3.90885351e-03
> > 744.66418457
> >
> > Here is what I get with Bouguet's Matlab toolbox:
> >             11578.1        0.             2014.5
> >             0.             11570.6        1416.6
> >             0.             0.              1
> > Distortion:  0.11679   -2.76960   -0.00072   -0.00582  0.00000
> >
> > I find it alarming that there is so little agreement between the two,
> > especially with respect to the distortion coefficients. OpenCV's
> > distortion coefficients look plain wrong. Any assistance would be much
> > appreciated. I'm new to OpenCV and am rapidly losing faith -- would
> > really appreciate some help in sorting this out.
> >
> > Matthew Fleming
> >
>


Reply | Threaded
Open this post in threaded view
|

Re: Calibration problems

mdale9_opencv
In reply to this post by mgfleming53202
Hi,

I've also been doing comparisons between OpenCV and Matlab and
although there may be slight differences they are small.
I have written MEX wrappers to call the OpenCV functions so that I get
the data back into Matlab (I also use Sun Peng's mc_convert code from
the Mathworks file exchange) and the results are comparable - one
thing to note is the zero based index in C versus the 1 based indexing
in Matlab - this threw me a bit when finding and mapping the
chessboard corners etc.
There is a difference in the StereoRectify code, between the Bouget
toolbox (June 2008 version) and OpenCV.  I have submitted a patch but
god knows if and when anyone on the development team will look at it!
-
http://sourceforge.net/tracker2/index.php?func=detail&aid=2495639&group_id=22870&atid=376679

Martin


--- In [hidden email], "mgfleming53202" <mfleming@...> wrote:

>
> I am trying to calibrate a single camera using a series of 10
> chessboard images. When I did this with OpenCV and then used the
> distortion coefficients to undistort images taken with the same
> camera, I got gibberish. So, I took a closer look at the distortion
> coefficients.
>
> Here are my results from OpenCV:
> Intrinsics: 1.14660566e+04 0.             2.04579358e+03
>             0.             1.14588232e+04 1.51486438e+03
>             0.             0.             1
> Distortion: 0.41165924 -31.90976524 3.71374376e-03 -3.90885351e-03
> 744.66418457
>
> Here is what I get with Bouguet's Matlab toolbox:
>             11578.1        0.             2014.5
>             0.             11570.6        1416.6
>             0.             0.              1
> Distortion:  0.11679   -2.76960   -0.00072   -0.00582  0.00000
>
> I find it alarming that there is so little agreement between the two,
> especially with respect to the distortion coefficients. OpenCV's
> distortion coefficients look plain wrong. Any assistance would be much
> appreciated. I'm new to OpenCV and am rapidly losing faith -- would
> really appreciate some help in sorting this out.
>
> Matthew Fleming
>