求助,空域直方图均衡化程序问题(数字图像处理)

这是我在书上抄的程序,但运行不出来
A=imread('C:\Users\asus\Desktop\C13.bmp');
I=histeq(A); %调用函数完成直方图均衡化
subplot(1,2,1),imshow(A); %直方图均衡化前的图像效果
subplot(1,2,1),imshow(I); %直方图均衡化后的图像效果
figure,subplot(1,2,1,),imshow(A); %均衡化前的直方图
subplot(1,2,1),imhist(I);
提示错误是
??? Error using ==> iptcheckinputFunction HISTEQ expected its first input, I, to betwo-dimensional.
Error in ==> histeq at 71 iptcheckinput(a,{'uint8','uint16','double','int16','single'}, ...
本人是菜鸟,不会,求高手解答

C13.bmp是彩色图吧?
直方图均衡是用来处理灰度图的,也就是黑白图片
在A=imread('C:\Users\asus\Desktop\C13.bmp');后面加一句

A=rgb2gray(A);%转化成灰度图
温馨提示:答案为网友推荐,仅供参考
相似回答