TP-probabilites/TP1/ecriture_RVB.m

16 lines
460 B
Mathematica
Raw Normal View History

2023-06-10 19:01:20 +00:00
## Author: Laurent <laurent@pop-os>
## Created: 2020-11-02
function image_RVB = ecriture_RVB(image_originale)
[H, L] = size(image_originale);
image_RVB = zeros(H/2, L/2);
image_RVB(:,:,1) = image_originale( 1:2:end, 2:2:end ); ## rouge
image_RVB(:,:,3) = image_originale( 2:2:end, 1:2:end ); ## bleu
image_RVB(:,:,2) = ( image_originale( 1:2:end, 1:2:end )
+ image_originale( 2:2:end, 2:2:end ) )/2; ## vert
endfunction