swarnim nayak
swarnim nayak

Reputation: 1

Histogram of ECG image in matlab

I want to ask how to find histogram of ECG image? As my program gives following error:

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{:});

My program is:

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

Upvotes: 0

Views: 370

Answers (1)

Jonas
Jonas

Reputation: 74940

Most likely, the image is stored as RGB. Consequently, you have to transform it to grayscale:

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

Upvotes: 3

Related Questions