exporting a single line matrix of the RGB averages
This commit is contained in:
parent
f05cb7110d
commit
3b7632c451
49
RGB_traces.m
49
RGB_traces.m
|
|
@ -1,28 +1,27 @@
|
|||
## Copyright (C) 2023 Loic
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation, either version 3 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
%%%%%%%%%%%%%%%%%%%%%
|
||||
% 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
|
||||
%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
## -*- texinfo -*-
|
||||
## @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)
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue