%% Read Strip of Data from YCbCr TIFF Image
% Read a strip of image data from a YCbCr TIFF file that contains an image with a stripped layout.

t = Tiff('peppers_YCbCr_stripped.tif','r');

% Determine the number of strips and the length of each strip in the image.

numberOfStrips(t)
getTag(t,'RowsPerStrip')

% Read and display the Y component of the third strip of the image. The readEncodedStrip function trims the area in a strip that falls outside of the ImageLength boundary. Therefore, image data from a strip at the bottom edge of the image can have different dimensions.

[Y,Cb,Cr] = readEncodedStrip(t,3);
imshow(Y);
title('3^{rd} Strip of Peppers Image (YCbCr)')

% Close the Tiff object.

close(t);

% Copyright 2012 The MathWorks, Inc.