我有一个色彩丰富的图像,我在MATLAB中转换为灰度。但是当我想显示灰度图像的直方图时,它输出的错误信息是
未定义的功能或变量'
imhist
'。
有趣的是,imread()
和imshow()
命令运行良好。我检查了图像处理工具箱是否已安装,看起来是肯定的。
>> license('test', 'image_toolbox')
ans =
1
另请参阅attachment中安装的工具箱的附件截图。
我使用的代码是:
clc;
close all;
clear all;
test_image = imread('fractals.jpg');
whos;
test_image(1,1,:);
test_image(200,262,:);
figure, imshow(test_image);
size(test_image)
test_image_gray = rgb2gray(test_image);
figure, imshow(test_image_gray)
%figure, imhist(test_image)
imhist(test_image_gray)