Wrong start
This commit is contained in:
parent
310a76fee7
commit
8381e4e9e6
|
|
@ -1,44 +0,0 @@
|
|||
%%%%%%%%%%%%%%%%%%%%%
|
||||
% Task: Creating FFT of average R,G,B over a period of 30 seconds
|
||||
%
|
||||
% Input:
|
||||
% - CSV file containing the RGB data for each pixels of the region of interest
|
||||
%
|
||||
% Output:
|
||||
% - Fast Fourier Transform of the colors over time
|
||||
%
|
||||
% author: Delattre Loïc, Dey Maryne (loic.delattre@ecam.fr, maryne.dey@ecam.fr)
|
||||
% date: 06/02/2023
|
||||
%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
pkg load io %% to be able to extract from external format (excel)
|
||||
|
||||
data = csvread('RGB_database/RGB_data.csv');
|
||||
standard_deviation = std(data);
|
||||
mean_value = mean(data);
|
||||
|
||||
for i = 1:size(data,1)
|
||||
normalized_data_G(i,1) = (data(i,2)-mean_value(2))/standard_deviation(2); %%2 and not 1 because green is the 2nd color
|
||||
endfor
|
||||
|
||||
normalized_data_G
|
||||
|
||||
fft_green = fft(normalized_data_G);
|
||||
|
||||
frequency = [];
|
||||
|
||||
for i = 1:length(fft_green)
|
||||
frequency(i) = (i-1)*30/length(fft_green);
|
||||
endfor
|
||||
|
||||
plot(frequency,fft_green)
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%For all the colors
|
||||
%%for j = 1:3
|
||||
%% for i = 1:size(data,1)
|
||||
%% normalized_data(i,j) = (data(i,j)-mean_value(j))/standard_deviation(j);
|
||||
%% endfor
|
||||
%%endfor
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
Loading…
Reference in New Issue