How can i display I of YIQ from a jpg image?

4 views (last 30 days)
YYK
YYK on 21 Apr 2022
Answered: DGM on 22 Apr 2022
I use the code:
I=imread("C:\File\oldtrafford.jpg");
YIQ= rgb2ntsc(I);
I2 = YIQ(:,:,1)&YIQ(:,:,2);
subplot(2,5,7)
imshow(I2);
title('[7] I-color(orange/blue',FontSize=7);
Is anything wrong?

Accepted Answer

DGM
DGM on 22 Apr 2022
The assignment text doesn't make any sense. The logical AND of Y and I or Y and Q isn't anything useful -- and it's certainly not a helpful hint.
I answered a similar question a while ago:
Maybe the difference here is that instead of trying to represent I and Q on some locus of constant luma, they want to actually substitute the luma into the visualization of I and Q. It doesn't really make sense to show it like that, but I guess you could.
A = imread('YIQ_components.jpg'); % original barn image montage
rgbframe = A(1:size(A,1)/4,:,:); % cropped RGB portion
img = rgb2ntsc(rgbframe);
[Y I Q] = imsplit(img);
a = zeros(size(img, 1), size(img, 2));
just_Y = repmat(Y,[1 1 3]); % replicate so that it can be concatenated
just_I = ntsc2rgb(cat(3, Y, I, a)); % use source Y instead of a flat field
just_Q = ntsc2rgb(cat(3, Y, a, Q));
% concatenate for simple viewing
imshow([im2double(rgbframe) just_Y; just_I just_Q]);
Compare this against the answer provided in the link above.

More Answers (0)

Tags

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!