I have calibrated my camera for radial and tangential distortion using OpenCV and would like to use the distortion parameters or xmap and ymap image values outside of the OpenCV environment. (I have a project where I am unable to use C++). Within the C environment, the xmap and ymap image files correct the images very well. However, I have looked at the values of the mapping files, and cannot understand how they are used to correct the images so that I could write routines. Same goes for the distortion parameters. I've tried to plug the k and p values into equations to make the correction and the resulting values are wrong. Any help would be appreciated.