Detect a edge as a function

조회 수: 5 (최근 30일)
Nguyen Tan Duoc
Nguyen Tan Duoc 2015년 9월 25일
댓글: Nguyen Tan Duoc 2015년 9월 25일
I have a image that are edges of an object (file attached)
Now, i want to detect all of edges as functions like X and Y vector. X contains position on x-axis, Y contains position on y-axis of every point in a edge (curve). Every edge (curve) has a function (a set of x,y vector). But i have no any algorithm to do that. I need a help

채택된 답변

Walter Roberson
Walter Roberson 2015년 9월 25일
cellfun(@(Col) find(YourImage(:,Col)), 1:size(YourImage,1), 'Uniform', 0)
  댓글 수: 3
Nguyen Tan Duoc
Nguyen Tan Duoc 2015년 9월 25일
Thanks a lost!

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

추가 답변 (1개)

Image Analyst
Image Analyst 2015년 9월 25일
If you can get a binary image instead of that, then you can use bwboundaries(). It looks like you used either edge() or bwperim(). Don't use bwperim if you want edge coordinates. You might want to experiment with activecontour() instead of edge().

Community Treasure Hunt

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

Start Hunting!

Translated by