MATLAB中edge函数用法>> I=imread('lena.jpg');>> BW1=edge(I,'sobel');Error using ==> iptcheckinputFunction EDGE expected its first input,I,to be two-dimensional.Error in ==> edge>parse_inputs at 541iptcheckinput(I,{'numeric','logical'},{'nonsparse
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/20 09:37:04
MATLAB中edge函数用法>> I=imread('lena.jpg');>> BW1=edge(I,'sobel');Error using ==> iptcheckinputFunction EDGE expected its first input,I,to be two-dimensional.Error in ==> edge>parse_inputs at 541iptcheckinput(I,{'numeric','logical'},{'nonsparse
MATLAB中edge函数用法
>> I=imread('lena.jpg');
>> BW1=edge(I,'sobel');
Error using ==> iptcheckinput
Function EDGE expected its first input,I,to be two-dimensional.
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{:});
MATLAB中edge函数用法>> I=imread('lena.jpg');>> BW1=edge(I,'sobel');Error using ==> iptcheckinputFunction EDGE expected its first input,I,to be two-dimensional.Error in ==> edge>parse_inputs at 541iptcheckinput(I,{'numeric','logical'},{'nonsparse
edge函数不能接收二进制图片~若是图片格式为.tiff就直接可以用~
二进制图像可以使用bwperim,但是是寻找图像的周边的.
如果你一定要使用edge函数,可以使用double强制把你的二进制图像转换成double型的.
例如:
Ijpg = imread('1.jpg'); %读取图像
BW1=im2bw(Ijpg,0.95);
BW2=double(BW1);
BW3=edge(BW2,'sobel');