# Scale Factor for Undistortion Matrix

I ran the calibration successfully on my image, and the undistortion worked great. Now I want to do it my hand, and I seem to be off by a scaling factor.

On the first page of the Calibration tutorial:

https://docs.opencv.org/2.4/doc/tutor...

the equation for removing radial distortion is x' = x(1+k1 r^2 + k2 r^4 + k3 r^6)

My camera matrix says that the center of my image is at (x0,y0) = (630,470)

I want to undistort a point in the picture at pixel location (70,70). So I calculate my r as:

sqrt( (630-70)^2 + (470-70)^2 ) = 688.

With my k values, I get an x' in the zillions, so clearly I need to scale my numbers before using the equation. Can someone tell me how to do this?