0
这里是我的代码:rgb2gray返回一个空白图像,而图像(I)返回正确的图像
I = imread(fullfile(vl_root,'data','cup1.jpg')) ;
%returns a picture of a cup
image(I)
colormap gray;
%returns a white blank picture
image(rgb2gray(I))
奇怪的是,下面的代码工作对我来说:
I = getsnapshot(vid);
%returns a picture of a snapshot
image(I)
colormap gray;
%returns a black and white picture
image(rgb2gray(I))
从我只能假设两种图像类型之间存在某种差异,但似乎无法确定原因。他们都是
有什么想法吗?