如果一个图本身就是黑白的用不用在转换成二维灰度图?
出错的程序如下:
>> I = 'D:\abc.jpg'
I =
D:\abc.jpg
>> [BW,thresh] = edge(I,'canny');
% 返回当前Canny算子边缘检测的阈值
disp('Canny算子自动选择的阈值为:')
disp(thresh)
subplot(121),imshow(BW);
title('自动阈值的Canny算子边缘检测')
BW = edge(I,'Canny',[0.2 0.5]);
% 以阈值为[0.1 0.5]对图像进行Canny算子检测
subplot(122),imshow(BW);
title('阈值为[0.1 0.5]的Canny算子边缘检测')
??? Error using ==> iptcheckinput
Function EDGE expected its first input, I,
to be one of these types:
double, single, uint8, uint16, uint32, int8, int16, int32, logical
Instead its type was char.
Error in ==> edge>parse_inputs at 541
iptcheckinput(I,{'numeric','logical'},{'nonsparse','2d'},mfilename,'I',1);
Error in ==> edge at 197
[a,method,thresh,sigma,thinning,H,kx,ky] = parse_inputs(varargin{:});
恳请路过的大侠帮忙
|