Matlab:特定像素的 RGB 到 HSV 值不起作用
Matlab: RGB to HSV Values of specific pixels not working
我一直在尝试使用以下代码获取几个 RGB 像素的 HSV 值
im = imread('peppers.png'); %// example image
c = [12 146 410]; %// column coordinates of desired pixels
r = [104 156 129]; %// row coordinates of desired pixels
pixels = impixel(im,c,r); %// rgb values of pixels
hsv = rgb2hsv(pixels); %// convert to hsv
hue = hsv(:,1); %// hue is first column of hsv
但是我得到一个错误,Valid colormaps cannot have values outside the range [0,1]
。
有人可以告诉我我的代码有什么问题吗?
我一直在尝试使用以下代码获取几个 RGB 像素的 HSV 值
im = imread('peppers.png'); %// example image
c = [12 146 410]; %// column coordinates of desired pixels
r = [104 156 129]; %// row coordinates of desired pixels
pixels = impixel(im,c,r); %// rgb values of pixels
hsv = rgb2hsv(pixels); %// convert to hsv
hue = hsv(:,1); %// hue is first column of hsv
但是我得到一个错误,Valid colormaps cannot have values outside the range [0,1]
。
有人可以告诉我我的代码有什么问题吗?