Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Importing Image for Colour Conversion
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi there,
I'm trying to use the colorspace transformation, which can be found here http://www.mathworks.com/matlabcentral/fileexchange/28790-colorspace-transformations
Here's the basic info on the function:
function varargout = colorspace(Conversion,varargin)
%COLORSPACE Transform a color image between color representations.
% B = COLORSPACE(S,A) transforms the color representation of image A
% where S is a string specifying the conversion. The input array %A should be a real full double array of size Mx3 or MxNx3. The % output B is the same size as A.
%
% S tells the source and destination color spaces, S = 'dest<-src', or
% alternatively, S = 'src->dest'.
%
% All conversions assume 2 degree observer and D65 illuminant.
So I've been trying to do this:
colour_wheel_lab = colorspace('hsv<-lab', colour_wheel)
But I keep getting error messages claiming there is an error when it gets to the source image Ii.e. image 'A' or the 'colour_wheel'). I've been loading the source image using 'imread' but I'm not sure if this puts it into the correct format for this function. Any ideas here? Do I need to convert the image into a different array?
Thanks in advance!
0 Kommentare
Antworten (1)
Walter Roberson
am 16 Apr. 2012
Notice that A should be "a real full double array". If you are using imread() then you are probably getting an uint8 image. Use im2double() to convert it.
1 Kommentar
Image Analyst
am 16 Apr. 2012
He has an LAB image so he's already converted the RGB image into LAB, but that can be either integer or double depending on how he obtained it. I think if you used the built-in MATLAB color conversion function, makecform, then you can get either an integer LAB out, if you passed in uint8, or you can get a floating point lab image, if you passed in a floating point image. The range of the L, A, and B also varies depending on what you passed in, integers or doubles, and I'm not sure any of them are what you'd get out of a spectrophotometer or colorimeter. I'm not sure what he'd get for lab if he used the File Exchange file. Justin, any reason why you're not using the built-in "makecform()" function?
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!