0

链接b.jpg

i=imread('b.jpg');
i1=rgb2gray(i);
i2=im2double(i);
j=log(1+i2);

1.

现在这是为了获取图像的直方图。

 imhist(j);

说错误:

??? Error using ==> iptcheckinput
Function IMHIST expected its first input, I or X, to be two-dimensional.

Error in ==> imhist>parse_inputs at 270
iptcheckinput(a, {'double','uint8','logical','uint16','int16','single'}, ...

Error in ==> imhist at 57
[a, n, isScaled, top, map] = parse_inputs(varargin{:});

==================================================== ============================

2.如何绘制功能图?

     plot(j,i2);

??? Error using ==> plot
Data may not have more than 2 dimensions

==================================================== ============================= 3.如何获得伽玛j

4

1 回答 1

0

我想,你一开始就犯了一个错误

i=imread('b.jpg');
i1=rgb2gray(i);
i2=im2double(i); % POSSIBLE MISTAKE
i2=im2double(i1);
j=log(1+i2);

更正后,(1)imhist(j)和(2)plot(j,i2);都可以正常工作。对于伽玛校正,您可以参考以下任一:Link-ALink-B

于 2012-04-25T16:30:33.007 回答