x = imread('flower.jpg');
%image is 700 by 940
x=x(1:640, 201:840, :); %crop the image so that its dimentsion is a multiple of 8
x=double(x);
r=x(:,:,1); 
g=x(:,:,2);
b=x(:,:,3);
xgray=0.2126*r+0.7152*g+0.0722*b;
xgray=uint8(xgray);
imagesc(xgray);colormap(gray)

size(x)
