function IMG_Bilinear = BilinearInterpolate( IMG );

IMG = double(IMG);
IMG_SIZE = size( IMG(:,:,1) );

RB_win = [1/4 1/2 1/4; 1/2 1 1/2; 1/4 1/2 1/4];
G_win = [0 1/4 0; 1/4 1 1/4; 0 1/4 0];
IMG_Bilinear = zeros( [IMG_SIZE, 3] );
IMG_Bilinear(:,:,1) = conv2( IMG(:,:,1), RB_win, 'same');
IMG_Bilinear(:,:,2) = conv2( IMG(:,:,2), G_win, 'same');
IMG_Bilinear(:,:,3) = conv2( IMG(:,:,3), RB_win, 'same');

IMG_Bilinear = uint8(IMG_Bilinear);
