# Forum

### Author Topic: Lens Distortion - Profile curve  (Read 1551 times)

#### Hugh

• Newbie
• Posts: 19
##### Lens Distortion - Profile curve
« on: August 05, 2022, 07:27:17 PM »
Hi,

I'm trying to understand how the distortion plot is calculated in the Camera Calibration window.

I've got, for example, the attached image.

In this, I'd expect to be able to pass in a pixel radius of 2000 and get a result of just under 12 pixels.

The details of this calibration are:

Code: [Select]
`w : 3840h : 2160f : 7617.05664k1 : 0.052014k2 : 0.689641k3 : -3.7671k4 : 0cx : 0cy : 0p1 : -0.00148237p2 : -0.0018401b1 : 0b2 : 0`
The corner of my image would be considered 0.5, 0.5, which is 1920, 1080 from the center. So the pixel distance to the corner is 2202.907. I'm going to use this point, and expect something around or just above 12.

r2 = r*r
r4 = r*r*r*r
etc...

I've used the formulae from Appendix C of the Metashape Pro documentation, on Frame cameras.

Code: [Select]
`x_prime = (x * (1 + k1*r2 + k2*r4 + k3*r6)) + (p1 * (r2 + (2 * x2))) + (2 * p2 * x * y) = 0.36136245y_prime = (y * (1 + k1*r2 + k2*r4 + k3*r6)) + (p2 * (r2 + (2 * y2))) + (2 * p1 * x * y) = 0.36118359u = w * 0.5 + cx + x_prime * f + x_prime * b1 + x_prime * b2 = 4672.52v = h * 0.5 + cy + y_prime * f = 3831.16`
This position in u,v is much more than 12 pixels away from the corner, so I'm not sure where my maths is going wrong here.

I tried doing this with p1 and p2 set to 0, and I got a similar result:

Code: [Select]
`x_prime = (x * (1 + k1*r2 + k2*r4 + k3*r6)) + (p1 * (r2 + (2 * x2))) + (2 * p2 * x * y) = 0.363764875y_prime = (y * (1 + k1*r2 + k2*r4 + k3*r6)) + (p2 * (r2 + (2 * y2))) + (2 * p1 * x * y) = 0.363764875u = w * 0.5 + cx + x_prime * f + x_prime * b1 + x_prime * b2 = 4690.82v = h * 0.5 + cy + y_prime * f = 3850.82`

Could someone help me as to where I'm going wrong here? I'd like to be able to calculate the same results as the graph is showing.

Thanks