【发布时间】:2013-12-27 23:33:47
【问题描述】:
我想使用内置函数 imhist() 查看图像的直方图,但我没有给我预期的直方图,而是用一条白线呈现。
这是我用来创建直方图的测试图像:http://tenettech.com/content/images/thumbs/0002817_basys2_spartan_3e_250k_gates_fpga_board_600.jpeg
这是我用来获取直方图的代码:
img = imread('test.jpg');
gray = rgb2gray(img);
hist = imhist(gray);
imshow(hist);
这是我从imshow(hist);得到的
http://i.imgur.com/0vCG7dx.jpg
很难看清楚,但在灰色背景下,它只是一条白线,顶部有黑点。
我期待这样的结果:http://nf.nci.org.au/facilities/software/Matlab/techdoc/ref/graphiac.gif
【问题讨论】:
标签: matlab image-processing histogram