dice icon indicating copy to clipboard operation
dice copied to clipboard

Distortion model

Open iniyanakila opened this issue 6 years ago • 4 comments

I have found the radial distortion parameters and the decentering distortion parameters using an in-house calibration code. Now, I would like to enter these parameter values in the .txt calibration input file. I have two questions:

  1. Is it possible to enter both the radial distortion parameters and the decentering distortion parameters in the calibration input file?

  2. Is the following the correct format ? xxxx # cx xxxx # cy xxxx # fx xxxx # fy xxxx # fs xxxx # k1 xxxx # k2 xxxx # k3 xxxx # k4 xxxx # k5 xxxx # cx xxxx # cy xxxx # fx xxxx # fy xxxx # fs xxxx # k1 xxxx # k2 xxxx # k3 xxxx # k4 xxxx # k5 xxxx # R11 xxxx # R12 xxxx # R13 xxxx # R21 xxxx # R22 xxxx # R23 xxxx # R31 xxxx # R32 xxxx # R33 xxxx # tx xxxx # ty xxxx # tz

iniyanakila avatar May 08 '19 14:05 iniyanakila

The text calibration format is getting depricated in DICe in favor of an xml format. The xml format is easier to use since you simply need to create a parameter named “k4” or “k5” and assign a value.

One thing to keep in mind is that the parameters you compute using your in-house calibration may have the same name or symbol as the ones used in DICe, but the distortion model may be very different. We have had trouble in the past with people using a commercial code like Vic3d to get k1, k2, etc. but then when DICe uses these parameters in the OpenCV distortion routines (which don’t have the same distortion model as Vic3d) things get messed up.

We are about to release another version of DICe (within the next couple weeks). If it’s possible to hold off until then you would have the ability to define the addition decentering distortion parameters in the new xml cal format. There isn’t a way to add these in the current .txt file format.

On May 8, 2019, at 8:56 AM, iniyanakila <[email protected]mailto:[email protected]> wrote:

I have found the radial distortion parameters and the decentering distortion parameters using an in-house calibration code. Now, I would like to enter these parameter values in the .txt calibration input file. I have two questions:

  1. Is it possible to enter both the radial distortion parameters and the decentering distortion parameters in the calibration input file?

  2. Is the following the correct format ? xxxx # cx xxxx # cy xxxx # fx xxxx # fy xxxx # fs xxxx # k1 xxxx # k2 xxxx # k3 xxxx # k4 xxxx # k5 xxxx # cx xxxx # cy xxxx # fx xxxx # fy xxxx # fs xxxx # k1 xxxx # k2 xxxx # k3 xxxx # k4 xxxx # k5 xxxx # R11 xxxx # R12 xxxx # R13 xxxx # R21 xxxx # R22 xxxx # R23 xxxx # R31 xxxx # R32 xxxx # R33 xxxx # tx xxxx # ty xxxx # tz

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/dicengine/dice/issues/118, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADT7TORHY4H6MKIPH2GGVX3PULS3XANCNFSM4HLSQKBA.

dicengine avatar May 08 '19 15:05 dicengine

Oh! that's great! thanks for your reply. I can wait for another two weeks. Thanks again,

Iniyan

iniyanakila avatar May 08 '19 15:05 iniyanakila

I should also mention that if you have a specific model that you want to use for lens distortion, it’s pretty straight forward to add your own model to the calibration routines in DICe. Let me know if you’re interested in creating a patch or a pull request for something like this.

On May 8, 2019, at 9:34 AM, iniyanakila <[email protected]mailto:[email protected]> wrote:

Oh! that's great! thanks for your reply. I would be happy to wait for another two weeks. Thanks again,

Iniyan

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/dicengine/dice/issues/118#issuecomment-490535737, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADT7TOW37DV6H7OQ66OIO4TPULXHPANCNFSM4HLSQKBA.

dicengine avatar May 08 '19 15:05 dicengine

I am currently using Brown's model, implementations found in Bouguet's code (http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/parameters.html) and in OpenCV (https://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html)

It will be interesting to see how other distortion models affect the results. This is something, which can be taken up in future, probably after the next release.

Yes, I will let you know when I am ready to create a patch or a pull request

Regards., Iniyan

iniyanakila avatar May 08 '19 19:05 iniyanakila