
matlab中的edge函数入口参数如何设置?
如果一个图本身就是黑白的用不用在转换成二维灰度图?出错的程序如下:>>I='D:\abc.jpg'I=D:\abc.jpg>>[BW,thresh]=edge(I,'ca...
如果一个图本身就是黑白的用不用在转换成二维灰度图?
出错的程序如下:
>> 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{:});
恳请路过的大侠帮忙 展开
出错的程序如下:
>> 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{:});
恳请路过的大侠帮忙 展开
展开全部
这种情况下建议用bwperim来提取边缘
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
I= imread('D:\abc.jpg'); %读入图像
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
底下不是有错误分析嘛。要将数据格式转化为double, single, uint8, uint16, uint32, int8, int16, int32, logical这几种类型。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
下载一个新版本。7太老了。比如2010b。到时你就不会有问题了。
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
I 必须是灰度图
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询