PPG_Delattre_Dey/RGB_traces.m

28 lines
590 B
Matlab

%%%%%%%%%%%%%%%%%%%%%
% function RGB_avg = RGB_traces (input1)
% ex. RGB_avgs = 2DRotationMatrix('frame0.jpg')
%
% Task: Extracting the average RGB values of a frame
%
% Inputs:
% - input1: frame adress on pc
%
% Output:
% -RGB_avg: a 1x3 matrix with the RGB average values, format -> [R, G, B]
%
% author: Loic Delattre (loic.delattre@ecam.fr)
% date: 06/02/2023
%%%%%%%%%%%%%%%%%%%%%
function RGB_avg = RGB_traces (image)
I = imread (image);
RGB_avg = [];
i = 3;
j = 1;
while i >= 1
RGB_avg(j) = matrix_avg (I(:,:,i));
j = j + 1;
i = i - 1;
endwhile
endfunction