TP-probabilites/TP1/ecriture_RVB.m
2023-06-10 21:01:20 +02:00

16 lines
460 B
Matlab

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