How to simulate distortion using opencv based on real data created using camera calibration (C ++)?

I am looking for a way to create (barrel) distortion using OpenCV in C ++, based on real camera data that are generated by calibrating the camera. So my goal is to simulate the actual distortion of the lens with opencv. So I calibrated the camera using OpenCV. I used only the first distortion parameter k1: x '= x * k1 * r² At this stage I received a calibration file with k1 = 0.129, the external and internal matrix of the camera.

OpenCV provides an image calibration method. And I would like to "invert" this method so that the following is possible for testing: Original image → undistort () → undistorted image → "distort ()" → original image

Is it possible to deny the factor k1 or is it necessary to develop a new formula?

Thanks.

+4
source share
1 answer

The short answer is, Without negation, the coefficient will not do this.

However, you can check the inverse of the coefficient, and you will get to form the inverse transformation until the coefficient is small. The formula does not have a trivial converse, so the path can be quite complicated.

+2
source

Source: https://habr.com/ru/post/1483183/


All Articles