exporting a single line matrix of the RGB averages

This commit is contained in:
Loic Delattre 2023-02-06 15:06:25 +01:00
parent f05cb7110d
commit 3b7632c451
1 changed files with 24 additions and 25 deletions

View File

@ -1,28 +1,27 @@
## Copyright (C) 2023 Loic %%%%%%%%%%%%%%%%%%%%%
## % function RGB_avg = RGB_traces (input1)
## This program is free software: you can redistribute it and/or modify % ex. RGB_avgs = 2DRotationMatrix('frame0.jpg')
## it under the terms of the GNU General Public License as published by %
## the Free Software Foundation, either version 3 of the License, or % Task: Extracting the average RGB values of a frame
## (at your option) any later version. %
## % Inputs:
## This program is distributed in the hope that it will be useful, % - input1: frame adress on pc
## but WITHOUT ANY WARRANTY; without even the implied warranty of %
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % Output:
## GNU General Public License for more details. % -RGB_avg: a 1x3 matrix with the RGB average values, format -> [R, G, B]
## %
## You should have received a copy of the GNU General Public License % author: Loic Delattre (loic.delattre@ecam.fr)
## along with this program. If not, see <https://www.gnu.org/licenses/>. % date: 06/02/2023
%%%%%%%%%%%%%%%%%%%%%
## -*- texinfo -*- function RGB_avg = RGB_traces (image)
## @deftypefn {} {@var{retval} =} RGB_traces (@var{input1}, @var{input2})
##
## @seealso{}
## @end deftypefn
## Author: Loic <Loic@LAPTOP-1F7SF0F7>
## Created: 2023-02-06
function retval = RGB_traces (image, iter)
I = imread (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 endfunction