How MTF blurs an image?

I would like to see how MTF blurs an image for my academic works. I will load the original image and I will have an MTF value (for example MTF=0.7), then I would like to have blurred image that is the result of the original image and MTF interaction. I appreciate it if anyone could give me a script or method suggestion.
Thanks in advance,

 Accepted Answer

Image Analyst
Image Analyst on 14 Feb 2021

0 votes

Use fspecial() to create Gaussian PSF's, which is just the spatial domain representation of the MTF. Then pass the PSF into imfilter().

8 Comments

ylcnt
ylcnt on 14 Feb 2021
Thank you for your reply.
I have the MTF value as MTF=0.56, spatial cutoff frequency as 6.67x10^3 cycle/rad, and spatial frequency as 20.000 cycle/rad. I tried it with Matlab, unfortunately, haven't been able to form a PSF/MTF conversion and apply it as a blurring filter effect up to now.
I use the code in below but can't get the effect I expect. Could you please say what is wrong? How can I convert MTF to PSf and then obtain a gaussian fpecial filter with the related parameters. I appreciate it if you could help me. Thank you.
origimage = imread('USAF','jpg');
MTF=0.56;
PSF = otf2psf(MTF); %obtain PSF from MTF
blurimage1=imfilter(origimage,PSF,'circular','conv');
You need to know how many radians per pixel you have in the spatial domain. What is it? Or else what is the max value of your fft2 in cycles per radian in the frequency domain?
ylcnt
ylcnt on 14 Feb 2021
I wrote the information that I have. I want to find atmospheric propagation effect on an image. I find the MTF versus spatial frequencies depending on environmental parameters. I have a reference image and want to know how blurry it will be with the obtained MTF. If I need the above parameters you mentioned, could you help me how to obtain and use them? Thank you.
If you don't know the angular subtense of your image then I don't. So you don't know the field of view width of your scene and you don't know the distance of the scene to the entrance pupil of your lens system?
The angle in radians is the arctangent of the FOV divided by the distance between the scene and the entrance pupil. Divide that angle by the number of columns across your image to get the radians per pixel value.
ylcnt
ylcnt on 14 Feb 2021
I have a generic image, USAF.jpg. I used aperture diameter as 3 cm. Could you please desribe for generic values, for example, focal length=35 mm, pixel size= 40 mm, distance is 20 m because it is in underwater medium. I am sorry for tiring you. Really I am not familiar with image processing, my subject is different. Thank you for your patience.
% Define how big the target is.
targetWidthInCm = 6;
% Define how far from the camera the target is.
targetDistanceInCm = 2000; % 20 m = 2000 cm
angle = atan(targetWidthInCm / targetDistanceInCm) % radians
angleInDegrees = deg2rad(angle)
% Define the number of samples across the image (the number of columns)
[rows, columns, numColorChannels] = size(rgbImage)
% Get the number of radians per pixel
samplingRate = angle / columns
ylcnt
ylcnt on 16 Feb 2021
Edited: ylcnt on 16 Feb 2021
Thank you very much for your contribution. I tried to go further but unfortunately I still could't form the structure.
Which parameters will be the input of the h = fspecial('gaussian',hsize,sigma) filter? What is hsize and sigma according to your script?
Then where will I use the obtained MTF value as an amplitude? Here MTF isn't only MTFoptic. It is MTFoptic*MTFatmosphere. That's my difficulty!
And then how to use B = imfilter(A,h,options,...)?
I am really very sory for taking your time.
The MTF is 1 at the zero frequency. You vary the sigma according to how much you want it to cut off the higher frequencies.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!