close lines after edge detection

Hi all, After edge detection and adding some circular object, I like to close the lines and fill each area. this is an example : http://i48.tinypic.com/35hq0cg.jpg
is there a way to close the lines without dilation or morfological operations? those would modify the accuracy of the detection.

2 件のコメント

Stephen
Stephen 2012 年 5 月 29 日
what was the original image?
Elad
Elad 2012 年 5 月 30 日
Its fungi on a leaf , but this image is after a few manipulations allready.

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

回答 (2 件)

Image Analyst
Image Analyst 2012 年 5 月 28 日

1 投票

Other options would be convex hull or restricted convex hull, or Sean's shrink wrap: http://www.mathworks.com/matlabcentral/fileexchange/29175-shrinkwrap

4 件のコメント

Elad
Elad 2012 年 5 月 29 日
Thanks, I'll try it.
Stelios Fanourakis
Stelios Fanourakis 2019 年 8 月 9 日
Hi.
Did you manage to solve your issue? Image Analyst, is there a way to apply the convex hull to pixels?
Image Analyst
Image Analyst 2019 年 8 月 10 日
Using a convex hull may not always be a good choice - it won't give the right shape in some situations. For a banana shape, it convex hull would give a D-shape. One must really look at the image and not just make blanket generalizations.
Stelios Fanourakis
Stelios Fanourakis 2019 年 8 月 21 日
Image Analyst. I want to apply convex hull to a closed contour shape. Thus, the convex hull shape is more or less defined when applied to a closed contour. Isn't it?

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

Walter Roberson
Walter Roberson 2012 年 5 月 28 日

0 投票

imfill( YourBWArray, 'holes' )

3 件のコメント

Elad
Elad 2012 年 5 月 28 日
Thanks but not all lines are closed, that's the problem.
Walter Roberson
Walter Roberson 2012 年 5 月 28 日
The example where the line leaves a gap: where should it attach to the main body? If the "accuracy of the detection" is an issue, every choice is wrong, unless there is external information available.
Elad
Elad 2012 年 5 月 29 日
Yes, you are right , I guess I would like to complete the closing in a circular way.
I found this answer that works sometimes, if the gap is small:
http://www.mathworks.com/matlabcentral/answers/23467-filling-the-objects-found-by-canny-edge

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

質問済み:

2012 年 5 月 28 日

コメント済み:

2019 年 8 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by