If you need to remove lens distortion effects from a whole image, you need to use dense remapping. Essentially, the undistortion algorithm warps and compresses the image in a way to compensate for lens effects, but compression leads to blank regions appearing. This recipe tells you how to undistort images and remove empty regions from the undistorted image.
Removing lens distortion effects from an image
Getting ready
Before you proceed with this recipe, you need to install the OpenCV version 3.3 (or greater) Python API package.
How to do it
You need to complete the following...