Matlab报错:需要的 第 1 个输入, I or X, 应为 二维

>> imhist(f);
错误使用 imhist
需要的 第 1 个输入, I or X, 应为 二维。


错误原因:读入的图片是三个维度的彩色图片,应该转换成二维的灰度图像。使用函数rgb2gray()将真彩色图像转换为灰度图像,即灰度化处理。


G=rgb2gray(f);
imhist(G);

posted @ 2019-06-16 22:15  Geeksongs  阅读(4060)  评论(0编辑  收藏  举报

Coded by Geeksongs on Linux

All rights reserved, no one is allowed to pirate or use the document for other purposes.