0

我有一张图像,我想计算它的直方图,但是这段代码返回错误给我,

 I=imread('image number one.bmp');
 imhist(I);

错误是

??? Error using ==> iptcheckinput
Function IMHIST expected its first input, I or X, to be two-dimensional.

Error in ==> imhist>parse_inputs at 281
iptcheckinput(a, {'double','uint8','int8','logical','uint16','int16','single','uint32',
'int32'}, ...

Error in ==> imhist at 59
[a, n, isScaled, top, map] = parse_inputs(varargin{:});

感谢任何帮助

4

1 回答 1

0

我找到了解决方案,我的图片是 rgb 和 imhist 仅在 2-D 输入中工作,我只需要将其转换为 grascale

 I=rgb2gray(I);
于 2013-05-14T16:17:30.663 回答