Need to Convert RGB color space to L*U*V* color space , Please tell am i correct with this code
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
rky
am 22 Jun. 2014
Kommentiert: fawad khan
am 16 Jul. 2018
%convert to RgbI image in RGB to XYZ
XYZTransformation = makecform('srgb2xyz');
XyzI = applycform(RgbI,XYZTransformation);
%seperate X,Y,Z
X = XyzI(:,:,1);
Y = XyzI(:,:,2);
Z = XyzI(:,:,3);
figure, imshow(X) , title('X');
figure, imshow(Y) , title('Y');
figure, imshow(Z) , title('Z');
xyz = cat(3, X,Y,Z);
figure, imshow(xyz) , title('xyz');
%convert to XYZ
labTransformation = makecform('xyz2uvl');
luvI = applycform(xyz,labTransformation);
%seperate X,Y,Z
u = luvI(:,:,1);
v = luvI(:,:,2);
l = luvI(:,:,3);
figure, imshow(l) , title('l');
figure, imshow(u) , title('u');
figure, imshow(v) , title('v');
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 22 Jun. 2014
Looks right to me. Just realize that any lab or luv or any other colorspace values you get from "book formulas" are not going to be the same as the "true" values you'd get from a spectrophotometer or spectroradiometer. This is because your system is not calibrated and it assumes the values are sRGB which is not true.
4 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!