error in edge command

Hello,
When I run the following code I get this message: ??? [BW,threshold]=edge(img,’zerocross’,[],'Laplacian'); | Error: The input character is not valid in MATLAB statements or expressions.
Could someone help me?
Thanks in advance
%%%%%% code%%%%%% clc;close all;clear *;
Laplacian=[1 1 1; 1 -8 1; 1 1 1];
img=double(imread('C:\Users\manolis\Desktop\ask4 sagkriwths\clown.tif')); [BW,threshold]=edge(img,’zerocross’,[],'Laplacian'); figure;imshow(img,[]) figure;imshow(BW)
disp(threshold)

3 件のコメント

Andrew Newell
Andrew Newell 2011 年 4 月 7 日
John, could you please format the code to make it readable? One command per line, indented two spaces (so the preview of the code looks grey).
john
john 2011 年 4 月 7 日
clc;
close all;
clear *;
Laplacian=[1 1 1; 1 -8 1; 1 1 1];
img=double(imread('C:\....\image.tif'));
[BW,threshold]=edge(img,’zerocross’,[],'Laplacian');
figure;imshow(img,[])
figure;
imshow(BW)
disp(threshold)
Andrew Newell
Andrew Newell 2011 年 4 月 7 日
That's better, but I meant replace your code in the question by the formatted code (click on "Edit").

サインインしてコメントする。

 採用された回答

Andrew Newell
Andrew Newell 2011 年 4 月 7 日

0 投票

You have the wrong kind of quotes around zerocross and should not have quotes around Laplacian. Try this:
[BW,threshold]=edge(img,'zerocross',[],Laplacian);

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by