Agisoft Metashape
Agisoft Metashape => Camera Calibration => Topic started by: shwetankumar on January 27, 2017, 03:43:29 AM
-
Hi,
I am curious to know what lens distortion formula to use for computing projection, given
1) Radial distortion co-efficients k1, k2, k3, k4
2) Tangential distortion co-efficients p1, p2, p3, p4
I found a formula in the Agisoft Lens User Manual Version 0.4.0, but it does not incorporate all the 8 distortion coefficients seen in an exported XML file.
x = X / Z
y = Y / Z
x' = x(1 + K1r2 + K2r4 + K3r6) + P2(r2+2x2) + 2P1xy
y' = y(1 + K1r2 + K2r4 + K3r6) + P1(r2+2y2) + 2P2xy
u = cx + x'fx + y'skew
v = cy + y'fy
Thanks !
-
Hello shwetankumar,
Please check Appendix C for additional information regarding the camera model used in PhotoScan and Lens:
http://www.agisoft.com/pdf/photoscan-pro_1_2_en.pdf
-
Thanks for the prompt response.
I notice that the formula provided in the updated manual contains 2 skew parameters (B1 and B2).
The attachment I added has just one parameter called skew. Which one of these is it ?
Also, I have separate fx and fy values for focal lengths and the model assumes just one focal length f.
-
Hello shwetankumar,
F = Fy
B1 = Fx - Fy
B2 = skew
-
Thanks Alexey !
That answers all my questions and I have a working projection pipeline.
:)
-
I have been using Agisoft for a significant amount of time now and getting consistent results.
However, this recent project has left me wondering what the issue is.
Can you please take a look at this image and data to help me figure out why the image projections are not landing at the correct location ?
A valid point in the point cloud has coordinates : -0.039719, -0.705446, -4.893686
The expected projected coordinates should be around (5330, 4950)
The camera parameters for the project are :
<calibration type="frame" class="adjusted">
<resolution width="10328" height="7760"/>
<fx>23282.294064453567</fx>
<fy>23282.294064453567</fy>
<cx>5164</cx>
<cy>3880</cy>
</calibration>
<camera id="0" label="ESCsxVA1Wsu3s8ng8QYI-A.jpg" sensor_id="0" enabled="true">
<transform>-9.9968057517408482e-001 -9.0622368175755051e-003 2.3592869335311253e-002 -1.9422496169494718e-001 -2.3565545517182495e-002 6.7156931266143183e-001 -7.4056689323512759e-001 4.2074425993339135e+000 -9.1330544774730765e-003 -7.4088631662037974e-001 -6.7156835330485753e-001 -5.1651663269224590e+000 0.0000000000000000e+000 0.0000000000000000e+000 0.0000000000000000e+000 1.0000000000000000e+000</transform>
</camera>
Thanks !