17 lines
223 B
Mathematica
17 lines
223 B
Mathematica
|
|
||
|
function X = moyenne(im)
|
||
|
|
||
|
I = single(im);
|
||
|
|
||
|
R = I(:,:,1);
|
||
|
V = I(:,:,2);
|
||
|
B = I(:,:,3);
|
||
|
|
||
|
M = max(1, R + V + B);
|
||
|
|
||
|
r = R ./ M;
|
||
|
v = V ./ M;
|
||
|
|
||
|
X = [ mean(r(:)) mean(v(:)) ];
|
||
|
|
||
|
end
|