tested, self explanitory

This commit is contained in:
Loic Delattre 2023-02-06 15:07:26 +01:00
parent 3b7632c451
commit 1b5d328bbd
1 changed files with 22 additions and 0 deletions

22
matrix_avg.m Normal file
View File

@ -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