Forum

Author Topic: Calibration coefficents  (Read 17672 times)

ahmed KIMOO

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Calibration coefficents
« on: November 12, 2016, 01:08:34 AM »
what are the mean of:
cx , cy , B1 , B2
in camera calibration ??
thanks,

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15468
    • View Profile
Re: parameters of camera calibration
« Reply #1 on: November 12, 2016, 02:02:27 PM »
Hello ahmed KIMOO,

The parameters of the camera calibration are described in the Appendix C of PhotoScan Manual.

cx and cy are principle point position, B1 and B2 - affinity and non-orthogonality.
Best regards,
Alexey Pasumansky,
Agisoft LLC

ccadiou01

  • Newbie
  • *
  • Posts: 10
    • View Profile
Calibration coefficents
« Reply #2 on: March 04, 2017, 12:04:47 PM »
Hi guys,

I would like to have some informations about calibration with photoscan.
I made a 3D Calibration test field with coded targets in order to compute the calibration of my camera. 3D coordinates of the targets are known. I took about 20 pictures of the targets field and I have imported and aligned them in PhotoScan. In order to compute the calibration of my camera, I used the "Optimize Cameras" tool by using my coded targets as known points.
Is this process correct?

And I have an other question. What are the units of K1, K2, K3, P1 and P2?

I tried to compute radial distortions with this formula: d = K1r2 + K2r4 + K3r6
With r the distance from the center of the sensor in mm.
But the results that I get are not very good.

PS: I use PhotoScan, not Agisoft Lens

Please Help !

Thanks, Cyril.


ccadiou01

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Calibration coefficents
« Reply #3 on: March 06, 2017, 06:26:11 PM »
Hi Alexey,

You moved my message in this topic but it doesn't help me a lot. I already read the manual but I don't find the units of K1, K2, K3, P1 and P2. I guess it's mm^-2 for K1, mm^-4 for K2 and mm^-6 for K3 but what about P1 and P2?

And is this formula the good one to compute radial distorsions? K1r2 + K2r4 + K3r6
I tried it but I think I get better results with only K1r2 + K2r4.
Is K3 important?
Here are the coefficients i got after my calibration:
K1 = 0.009676913
K2 = -0.017303725
K3 = 0.017601049
And the distorsion for r = 2 mm (exemple) is 0.88831518

Is that correct?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15468
    • View Profile
Re: Calibration coefficents
« Reply #4 on: March 06, 2017, 08:04:34 PM »
Hello Cyril,

The coefficients in the used model are dimensionless. Also keep in mind that r values are also not in mm and are normalized by the pixel size.
Best regards,
Alexey Pasumansky,
Agisoft LLC

ccadiou01

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Calibration coefficents
« Reply #5 on: March 07, 2017, 10:30:04 AM »
Hello Alexey,

Thanks for the reply.
Do you mean it's r = 2/pixel size for the distance  2mm from the center?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15468
    • View Profile
Re: Calibration coefficents
« Reply #6 on: March 07, 2017, 12:12:52 PM »
Hello Cyril,

In the formula from the manual r is normalized, so it would be either r = r_mm / f_mm or r = r_pix / f_pix, where f - focal length in mm or pixels. f_pix = f_mm / sensor_pixel_size (mm/pix).

So if you need to calculate dr_mm from r_mm you can use the following:
dr_mm = K1 * (r_mm ^ 3 / f_mm ^ 2) + K2 * (r_mm ^ 5 / f_mm ^ 4) + ...

Additional important notice is related to the r itself - in our model it is corrected distance, not the original.
Best regards,
Alexey Pasumansky,
Agisoft LLC

ccadiou01

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Calibration coefficents
« Reply #7 on: March 07, 2017, 05:34:25 PM »
Hello Alexey,

Thank you very much ! It worked.
Why is it not written in the manual? I think it could be useful for a lot of people (or maybe just for me  ;D ).
I already worked with PhotoModeler and a calibration toolbox on Matlab. Both work with the Brown's model (like PhotoScan) but coefficients and r are not the same. The world of photogrammetry is complicated  :P

I just have two other questions and then I leave you alone.

 - why is the radius r divided by the focal length f? You said it's normalized, but why f?
 - and is it possible to compute K1 and K2 without K3 or K1 without K2 and K3?

ccadiou01

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Calibration coefficents
« Reply #8 on: March 07, 2017, 06:41:40 PM »
Sorry, I thought it was over with questions but I just found another one.

Now I want to compute tangential distortions.
Here is the formula from the manual: P1(r²+2x²)+2*P2**x*y
with x = X/Z and y = Y/Z
(X, Y, Z) - point coordinates in the local camera coordinate system and the local camera coordinate system has origin at the camera projection center. The Z axis points towards the viewing direction, X axis points to the right, Y axis points down.
I think it's easy to find X and Y but how can I find Z?

ccadiou01

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Calibration coefficents
« Reply #9 on: March 13, 2017, 10:35:30 AM »
?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15468
    • View Profile
Re: Calibration coefficents
« Reply #10 on: March 13, 2017, 12:45:19 PM »
Hello Cyril,

We are normalizing by the focal length, as such approach has some advantages in the implementation.

If you need to leave some parameters uncalibrated, you can swap their values to zeros in the Adjusted tab of the Camera Calibration window and then optimize the alignment, including only the parameters that you wish to be adjusted.

As for the last question X, Y and Z are the coordinates of the point in the camera coordinate system, but you cannot get Z, having only information about the projection, because the points that lay on the same ray will be projected to the same point on the image.
Best regards,
Alexey Pasumansky,
Agisoft LLC

ccadiou01

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Calibration coefficents
« Reply #11 on: March 13, 2017, 03:53:09 PM »
Hello Alexey,

Thank you for the reply.

Unfortunately, it's not possible to adjust only the k1 coefficient without k2 and k3 during the optimization afetr swaping their values to zero (see the attached picture). Or maybe I didn't get something.

As for the last question X, Y and Z are the coordinates of the point in the camera coordinate system, but you cannot get Z, having only information about the projection, because the points that lay on the same ray will be projected to the same point on the image.

So, how do I compute the tangential distorsions for my sensor? Which x and y do I use for this formula P1(r²+2x²)+2*P2*x*y ?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15468
    • View Profile
Re: Calibration coefficents
« Reply #12 on: March 13, 2017, 04:40:30 PM »
Hello Cyril,

The screenshot you have provided is from the old version of PhotoScan. Already in 1.2.6 it is possible to optimize the parameters separately.
Best regards,
Alexey Pasumansky,
Agisoft LLC

ccadiou01

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Calibration coefficents
« Reply #13 on: March 13, 2017, 08:07:23 PM »
Hello Alexey,

Oh yes I'm using the old version... Thank you, I didn't notice it.
And what about the tangential distorsions?
« Last Edit: March 15, 2017, 01:20:13 PM by ccadiou01 »

ccadiou01

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Calibration coefficents
« Reply #14 on: March 15, 2017, 01:21:19 PM »

And what about the tangential distorsions?