I =fopen('foreman_420.yuv');
P =fread(I, '*uint8');
q=reshape(P,152064,10);
X=q(:,5);
Y=reshape(X,352,432);
U = Y(:, 289:360);
V = Y(:, 361:432);
U1=reshape(U,176,144);
V1=reshape(V,176,144);
U2=imresize(U1,[352,288])';
V2=imresize(V1,[352,288])';
figure
imagesc(U2)
figure
imshow(U2)
% figure
% imagesc(V2)
Y2=Y(:,1:288)';
% figure
% imagesc(Y2);
Z=cat(3,Y2,U2,V2);
Im=ycbcr2rgb(Z);
figure
imshow(Im)
P =fread(I, '*uint8');
q=reshape(P,152064,10);
X=q(:,5);
Y=reshape(X,352,432);
U = Y(:, 289:360);
V = Y(:, 361:432);
U1=reshape(U,176,144);
V1=reshape(V,176,144);
U2=imresize(U1,[352,288])';
V2=imresize(V1,[352,288])';
figure
imagesc(U2)
figure
imshow(U2)
% figure
% imagesc(V2)
Y2=Y(:,1:288)';
% figure
% imagesc(Y2);
Z=cat(3,Y2,U2,V2);
Im=ycbcr2rgb(Z);
figure
imshow(Im)