필터 지우기
필터 지우기

to find length of edges

조회 수: 14 (최근 30일)
christian  bale
christian bale 2012년 1월 10일
is there any function for finding out the length of the edges and average number of edges...?actually i hav to determine the edges using canny edge detection method.So how can i find out the length and average number of edges?
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 1월 10일
The number of edges averaged over what?

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2012년 1월 10일
The edge image returned by edge() is a logical image. So to get the length of all the edges, you do
lengthOfEdges = sum(edgeImage);
To get the number of edges:
[labeledImage numberOfEdges] = bwlabel(edgeImage);
To get average edge length (which you didn't ask for but I'm giving you anyway in case you need it), it's
averageEdgeLength = lengthOfEdges / numberOfEdges;
To get the average number of edges you have to define (like Walter asked) what you're averaging over.
  댓글 수: 2
David Young
David Young 2012년 1월 11일
I think you mean sum(edgeImage(:)) or sum(sum(edgeImage))
Image Analyst
Image Analyst 2012년 1월 11일
Correct - good catch!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

David Young
David Young 2012년 1월 10일
Guessing a little, but I suspect that the following functions will be sufficient:
  • sum
  • bwlabel
  • regionprops

Community Treasure Hunt

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

Start Hunting!

Translated by