graphing an MTF from an image

172 Ansichten (letzte 30 Tage)
Abdulrahman Alsalmi
Abdulrahman Alsalmi am 6 Apr. 2022
Beantwortet: Abhishek Chakram am 14 Feb. 2024
Hello everyone,
If I have a captured image of a thermal imager with halfmoon target and I want to find the MTF of that image.
What would be the right code to that.
I tried graphing it but i didnt succeed.
Let's consider the below graph as the edge that I want to find the MTF of.
What I want to do is as follow:
1- To find the size (resolution of that image)
2- To find the edge response function (ESF)
3- To find the line spread function (LSF) from the edge response.
4- To graph the MTF from the line spread function (LSF)
It should seems like the below picture
Your help will be so much appreciated.
Thank you in advance.

Antworten (1)

Abhishek Chakram
Abhishek Chakram am 14 Feb. 2024
Hi Abdulrahman Alsalmi,
To calculate the Modulation Transfer Function (MTF) from an image of a thermal imager with a half-moon target, you need to follow a series of steps that involve image processing techniques. Below is a high-level outline of the MATLAB code for the same:
% Assuming 'thermalImage' is your loaded thermal image with a half-moon target
% Step 1: Find the size (resolution) of the image
[rows, columns, ~] = size(thermalImage);
% Step 2: Find the edge response function (ESF)
% This usually involves finding the edge of the half-moon target and then
% extracting the pixel values across that edge.
% Convert the image to grayscale if it is not already
grayImage = rgb2gray(thermalImage);
% Find edges using an edge detection algorithm like 'Sobel'
edges = edge(grayImage, 'sobel');
% You may need to process 'edges' to find the actual edge of the half-moon
% For simplicity, let's assume 'edgeRow' is the row index of the half-moon edge
edgeRow = findEdgeRow(edges); % You need to implement this function
% Extract the edge response function (ESF)
ESF = double(grayImage(edgeRow, :));
% Step 3: Find the line spread function (LSF) from the ESF
% The LSF is the derivative of the ESF
LSF = diff(ESF);
% Step 4: Graph the MTF from the LSF
% The MTF is the magnitude of the Fourier Transform of the LSF
MTF = abs(fft(LSF));
% Normalize the MTF by its maximum value
MTF = MTF / max(MTF);
% Create a frequency axis for plotting
frequencyAxis = linspace(0, columns/2, numel(MTF)/2);
% Plot the MTF
figure;
plot(frequencyAxis, MTF(1:numel(MTF)/2));
xlabel('Spatial Frequency (cycles per pixel)');
ylabel('MTF');
title('Modulation Transfer Function');
You can refer to the following documentation to know more about the functions used:
Best Regards,
Abhishek Chakram

Kategorien

Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by