필터 지우기
필터 지우기

error in edge command

조회 수: 1 (최근 30일)
john
john 2011년 4월 7일
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
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일
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개)

Community Treasure Hunt

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

Start Hunting!

Translated by