# Parameters for inverse image distortion

I'm trying to simulate camera (barrel/radial) distortion, and to reverse it. I.e. a process that would do:

Image --> Distorted Image --> ~ Image


In particular, given an image I, one can create a distorted image (with barrel distortion) with a function f(I,*params). Now the question is: what are a set of new parameters new_params such that f(f(I,*params),*new_params)~I?

At the moment, I am using Python and OpenCV's cv2.undistort which has as inputs the image I, a camera parameter matrix cam, and some distortion coefficients (k1 and k2 for barrel distortion).

I found an article "An Exact Formula for Calculating Inverse Radial Lens Distortions" by P. Drap, and J. Lefèvre which suggests that the parameters for the inverse transformation would be:

k1' = -k1
k2' = 3 * k1**2 - k2


I have tried implementing this, but with very low success. I am not sure whether I have missed something or if maybe one has to also find a new camera matrix new_cam to obtain the original undistorted image.

Any help is highly appreciated.