tested, self explanitory
This commit is contained in:
parent
3b7632c451
commit
1b5d328bbd
|
|
@ -0,0 +1,22 @@
|
|||
%%%%%%%%%%%%%%%%%%%%%
|
||||
% 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
|
||||
%
|
||||
% author: Loic Delattre (loic.delattre@ecam.fr)
|
||||
% date: 06/02/2023
|
||||
%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
function Mavg = matrix_avg (M)
|
||||
col = size(M,2);
|
||||
row = size(M,1);
|
||||
num_items = col*row;
|
||||
Mavg = sum(sum(M))/num_items;
|
||||
endfunction
|
||||
Loading…
Reference in New Issue