SUNY Geneseo Department of Mathematics
Monday, October 6
Math 230 01
Fall 2014
Prof. Doug Baldwin
chromakey( S, B )
Subtract background color from S
…
>> S = zeros( 2, 2, 3 )
S(:,:,1) =
0 0
0 0
S(:,:,2) =
0 0
0 0
S(:,:,3) =
0 0
0 0
>> S(:,:,1) = [128 128; 128 128]
S(:,:,1) =
128 128
128 128
S(:,:,2) =
0 0
0 0
S(:,:,3) =
0 0
0 0
>> S(:,:,2) = [255 255; 255 255]
S(:,:,1) =
128 128
128 128
S(:,:,2) =
255 255
255 255
S(:,:,3) =
0 0
0 0
>> S(:,:,3) = [255 255;255 255]
S(:,:,1) =
128 128
128 128
S(:,:,2) =
255 255
255 255
S(:,:,3) =
255 255
255 255
>> S( 1, 2, : ) = [0 0 0]
S(:,:,1) =
128 0
128 128
S(:,:,2) =
255 0
255 255
S(:,:,3) =
255 0
255 255
>> S2 = uint8( S );
>> image( S2 )