Different value from Matlab function NTSC2RGB when multiplying with the given yiq to rgb conversion matrix?

1 view (last 30 days)
I am using matlab function ntsc2rgb but its output differs from the actual multiplication of the matrix function given on the matlab webpage.
http://www.mathworks.in/help/images/ref/ntsc2rgb.html nI is a 3 dimensional ntsc value matrix.
fprintf('before\n');
for i=1:2
for j=1:2
for t=1:3
disp(sprintf('%g %g %g %g', i , j , t ,nI([i],[j],[t])));
end
end
end
fprintf('after\n');
nI=ntsc2rgb(nI);
for i=1:2
for j=1:2
for t=1:3
disp(sprintf('%g %g %g %g', i , j , t ,nI([i],[j],[t])));
end
end
end
Matlab shows this output
before
1 1 1 0.956863
1 1 2 -0.165627
1 1 3 -0.0367254
1 2 1 0.956863
1 2 2 -0.165627
1 2 3 -0.0367253
2 1 1 0.952941
2 1 2 -0.165569
2 1 3 -0.0367732
2 2 1 0.952941
2 2 2 -0.165568
2 2 3 -0.0367733
after
1 1 1 0.719921
1 1 2 0.9519
1 1 3 1
1 2 1 0.719921
1 2 2 0.951899
1 2 3 1
2 1 1 0.71902
2 1 2 0.951868
2 1 3 1
2 2 1 0.71902
2 2 2 0.951868
2 2 3 1
But actual value should be
value of 0 0 0 0.776073
value of 0 0 1 1.025472
value of 0 0 2 1.077615
value of 0 1 0 0.776073
value of 0 1 1 1.025472
value of 0 1 2 1.077615
value of 1 0 0 0.772224
value of 1 0 1 1.021548
value of 1 0 2 1.073515
value of 1 1 0 0.772224
value of 1 1 1 1.021548
value of 1 1 2 1.073515

Answers (0)

Community Treasure Hunt

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

Start Hunting!