function [Y,Cb,Cr]=convertYCbCr(x)
% x is an mxnx3 RGB image
% Y,Cb,Cr are the three mxn components Luminance + chrominance image
x = double(x);
Y(:,:)=x(:,:,1)*0.299+x(:,:,2)*0.587+x(:,:,3)*0.114;
Cb(:,:)=-x(:,:,1)*0.1687-x(:,:,2)*0.3313+x(:,:,3)*0.5+128;
Cr(:,:)=x(:,:,1)*0.5-x(:,:,2)*0.4187-x(:,:,3)*0.0813+128;