Use the edge function in matlab

As previous metioned that I install the matlab on our linux workstation and last night & this morning just write matlab code to give an edge of an image

frist learn the help file in the matlab

It's easy

and in the ommand window just type the command like this:

>> I = imread('1.png');

It's all right

and then

>> BW = edge(I,'prewitt');

there are some errors

??? Function EDGE expected its first input, I, to be two-dimensional.

Error in ==> edge>parse_inputs at 564
iptcheckinput(I,{'numeric'},{'nonsparse','2d'},mfilename,'I',1);

Error in ==> edge at 197
[a,method,thresh,sigma,thinning,H,kx,ky] = parse_inputs(varargin{:});


what's wrong?

That because file the edge function needed must 256-bit file

你可能感兴趣的:(我的奋斗)