# Forum

### Author Topic: Camera Projection Model with 8 distortion coefficients  (Read 3766 times)

#### shwetankumar

• Newbie
• Posts: 20
##### Camera Projection Model with 8 distortion coefficients
« 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 !

#### Alexey Pasumansky

• Agisoft Technical Support
• Hero Member
• Posts: 9263
##### Re: Camera Projection Model with 8 distortion coefficients
« Reply #1 on: January 27, 2017, 11:06:37 AM »
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

Best regards,
Alexey Pasumansky,
AgiSoft LLC

#### shwetankumar

• Newbie
• Posts: 20
##### Re: Camera Projection Model with 8 distortion coefficients
« Reply #2 on: January 27, 2017, 05:49:28 PM »
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.

#### Alexey Pasumansky

• Agisoft Technical Support
• Hero Member
• Posts: 9263
##### Re: Camera Projection Model with 8 distortion coefficients
« Reply #3 on: January 28, 2017, 07:49:22 PM »
Hello shwetankumar,

Code: [Select]
`F = FyB1 = Fx - FyB2 = skew`
Best regards,
Alexey Pasumansky,
AgiSoft LLC

#### shwetankumar

• Newbie
• Posts: 20
##### Re: Camera Projection Model with 8 distortion coefficients
« Reply #4 on: January 30, 2017, 10:01:28 PM »
Thanks Alexey !

That answers all my questions and I have a working projection pipeline.

#### shwetankumar

• Newbie
• Posts: 20
##### Re: Camera Projection Model with 8 distortion coefficients
« Reply #5 on: February 10, 2017, 06:48:41 PM »
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 :

<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 !

#### doler

• Newbie
• Posts: 1
##### Re: Camera Projection Model with 8 distortion coefficients
« Reply #6 on: February 17, 2017, 06:24:26 AM »