>> [X,map]=imread('D:\pic\UF2006325103210.jpg');
>> map=[[0:1/256:255/256]',[0:1/256:255/256]',[0:1/256:255/256]'];
>> X=uint(255-double(X));
>> imshow(X,map)
Warning: Displaying real part of complex input
> In D:\MATLAB6p5\toolbox\images\images\imshow.m (ParseInputs) at line 503
In D:\MATLAB6p5\toolbox\images\images\imshow.m at line 90
??? Error using ==> real
Function 'real' is not defined for values of class 'struct'.
Error in ==> D:\MATLAB6p5\toolbox\images\images\imshow.m (ParseInputs)
On line 504 ==> cdata = real(cdata);
Error in ==> D:\MATLAB6p5\toolbox\images\images\imshow.m
On line 90 ==> [imtype, cdata, cdatamapping, clim, map, xdata, ydata, filename, ...
用rgb2gray函数,将彩色图像转化为灰度图像。
matlab程序把彩色图像变成黑白,只需要反色处理一下就可以了
把彩色图像变成黑白的,里面放上你的图片名就可以了,建议楼主看下!
把彩色图像变成黑白的 rgb2gray
具体怎么用 help一下就知道了 里面放上你的图片名就可以了
这个肯定行 你试试