I would like to be able to foveate an image with focal point at the center of the image in Python. My input image can be represented as a 2D Numpy array. I'd like to get an output image with high resolution at the center, but blurry at the sides. I found an OpenCV function called logplar_interp for this purpose, but it does not seem to be present in the Python wrap of OpenCV. I appreciate any help.
An example of a foveated image is shown below (taken from Wikipedia):
The point of focus is the bee at the upper left corner while the rest of the pixels become progressively blurred as you move away from the point of focus.
解决方案
Here's my attempt at recreating this using OpenCV Python. It's a rather hack-ish solution that is a bit computationally intensive, but it certainly gets the job done.
First, create a mask where pixels that are zero correspond to those pixels you want to keep at high resolution and pixels that are one correspond to those pixels you want to blur. To make things simple, I would create a circle of dark pixels that define the high resolution pixels.
With this mask, one tool that I can suggest to make this work is to use the distance transform