Hi Jose,
I understand that you want to know how to analyze infrared video thermography data of the calcaneus tendon to obtain temperature information over time and its power spectral density (PSD) in the frequency domain.
Please refer to the following steps to get the temperature information for each frame in the video.
- Read the video file using "VideoReader” function.
- Initialize an array to store average temperature values for each frame.
- Loop through each frame using "readFrame" function.
- For each frame, convert the pixel values to temperature values using the calibration data.
- Calculate the average temperature of the region of interest (ROI) which is the calcaneus tendon and store it in the array.
Please refer to the following steps to get the power spectral density (PSD).
- Use the average temperature values array obtained and stored in the previous steps for each frame.
- Compute the Fast Fourier Transform (FFT) using "fft"`function.
- Calculate the frequency vector using the sampling rate (frame rate of the video).
- Obtain the power spectral density (PSD) using the squared magnitude of the FFT result divided by size of array.
- Plot and visualize the frequency spectrum and identify significant frequencies.
Please refer to the pseudo code below:
videoFile = 'videoPath.avi';
v = VideoReader(videoFile);
avgTemp = zeros(1, numFrames);
tempData = convertToTemperature(frame);
roi = tempData(roi_y:(roi_y+roi_height), roi_x:(roi_x+roi_width));
avgTemp(idx) = mean(roi);
PSD = (1/(Fs*L)) * abs(FFT(1:L)).^2;
Please refer to the documentation below to learn more about "VideoReader" function.
Please refer to the documentation below to learn more about "readFrame" function.
Please refer to the documentation below to learn more about ''fft" function.
Hope it helps!