matlab中心电图图像的直方图

时间:2012-08-15 14:47:46

标签: image matlab

我想问一下如何找到心电图图像的直方图? 由于我的程序出现以下错误:

Function IMHIST expected its first input, I or X, to be two-dimensional.

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

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

我的节目是:

Im1 = imread('pic1.jpg');Im = im2double(Im1);figure,imhist(Im)

1 个答案:

答案 0 :(得分:3)

最有可能的是,图像存储为RGB。因此,您必须将其转换为灰度:

Im1 = imread('pic1.jpg');
Im = im2double(Im1);
Im = rgb2gray(Im); %# convert to grayscale
figure,imhist(Im)