How can I save and reuse the results of the FFT applied on an image to calcuate the bessel potential?

210 views Asked by At

Please can you help me correcting this code? I want to save the result of the Fast Fourier Transform of each image apart so I can reuse the proper coefficients for every band of wave I get from the FFT to calculate the bessel potential of the function? My code is below,

clc;
close all;
imagefiles = dir('*.jpg'); %any jpg file found in the folder
nfiles = length(imagefiles);    % Number of image files found
stored_values = cell(1,nfiles); % Preallocate the array for saving the values

for ii=1:nfiles

    currentfilename = imagefiles(ii).name;
    I = imread(currentfilename);
    myimage = rgb2gray(I);
    Y = fft2(myimage)
    fftMagnitude = abs(fftshift(Y))
    stored_values{ii}=fftMagnitude %store values of fft

    syms Y
    A = [-1, pi; Y, 0];
    J = besselj((1/2), A)
    stored_values{ii}=J  %save the besselj result in another cell ??

end

The code runs correctly but it's not giving numbers in arrays it's just showing the dimension of the image so I think that I'm mistaking the way of saving and calling the datas again. Can you please help? Thank you.

0

There are 0 answers