How can one implement the fisheye lens effect illustrated in that image:

One can use Google’s logo for a try:

BTW, what’s the term for it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I believe this is typically referred to as either a “fisheye lens” effect or a “barrel transformation”. Here are two links to demos that I found:
Sample code for how you can apply fisheye distortions to images using the
'custom'option for the functionmaketformfrom the Image Processing Toolbox.An image processing demo which performs a barrel transformation using the function
tformarray.Example
In this example, I started with the function
radial.mfrom the first link above and modified the way it relates points between the input and output spaces to create a nice circular image. The new functionfisheye_inverseis given below, and it should be placed in a folder on your MATLAB path so you can use it later in this example:The fisheye distortion looks best when applied to square images, so you will want to make your images square by either cropping them or padding them with some color. Since the transformation of the image will not look right for indexed images, you will also want to convert any indexed images to RGB images using
ind2rgb. Grayscale or binary images will also work fine. Here’s how to do this for your sample Google logo:Now we can create the transform with
maketformand apply it withimtransform(orimwarpas recommended in newer versions):And here’s the image you should see:
You can adjust the degree of distortion by changing the third value in the
optionsarray, which is the exponential power used in the radial deformation of the image points.