I am looking for a way to create (barrel) distortion with OpenCV in C++ that is based on real camera data, that are generated by camera calibration. So my target is to simulate real lens distortion with opencv. Therefor I calibrated a camera with OpenCV. I've only used the first distortion parameter k1: x' = x * k1*r² With this step I got a calibration file with k1 = 0.129, the extrensic and intrinsic camera matrix.
OpenCV provides a method to calibrate an image. And I would like to "inverse" this method, that the following is possible for testing: Original image -> undistort() -> undistort image -> "distort()" -> original image
Is it possible to negate the k1 factor or is it necessary to develop a new formula?
Thanks.