MATLAB: How do i correctly display the Y component of a YIQ image

yiq

Current I just did
YIQ = rgb2ntsc(RGB);
Y = YIQ(:,:,1);
imshow(Y)

Best Answer

imshow(Y) is correct. The data you get will be in the range 0 to 1; imshow will detect that, and will automatically add in a grayscale colormap.
You can also use
Y8 = im2uint8(Y);
and now if you
Z = rgb2gray(RGB);
then Y8 and Z should be identical (or nearly so -- identical in the test I did.)