英文:
Changing colorspace in MATLAB
问题
I'm trying to convert RGB color space to lαβ in MATLAB.
I tried running the script, I'm getting a rather different type of error.
>> C = makecform('srgb2lab')
C =
struct with fields:
c_func: @applycformsequence
ColorSpace_in: 'rgb'
ColorSpace_out: 'lab'
encoding: 'double'
cdata: [1×1 struct]
>> C(HCC1)
Array indices must be positive integers or logical values.
HCC1 is a tiff image loaded from my local PC. To add I'm using the online version of MATLAB.
EDIT: Link to Image
英文:
I'm trying to convert RGB color space to lαβ in MATLAB.
I tried running the script, I'm getting a rather different type of error.
>> C = makecform('srgb2lab')
C =
struct with fields:
c_func: @applycformsequence
ColorSpace_in: 'rgb'
ColorSpace_out: 'lab'
encoding: 'double'
cdata: [1×1 struct]
>> C(HCC1)
Array indices must be positive integers or logical values.
HCC1 is a tiff image loaded from my local PC. To add I'm using the online version of MATLAB.
here's the link to the image I'm trying to convert.
答案1
得分: 2
我相信你应该使用applycform()
函数来应用这个"cform"对象。
makecform
的文档显示了以下示例:
rgb = imread('peppers.png');
cform = makecform('srgb2lab');
lab = applycform(rgb, cform);
英文:
I believe you are expected to apply this "cform" object using applycform()
Documentation for makecform
shows this example:
rgb = imread('peppers.png');
cform = makecform('srgb2lab');
lab = applycform(rgb,cform);
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论