Skip to content

Does 2D FillHoles has the concept of scipy's 'structure' ? #173

Answered by crisluengo
ogencoglu asked this question in General
Discussion options

You must be logged in to vote

DIPlib’s FillHoles() is controlled by a connectivity parameter. This is equivalent to choosing a 3x3 diamond or a 3x3 square structuring element in binary_fill_holes. We don’t allow arbitrary neighborhoods because (1) you don’t necessarily get useful results with them, and (2) it makes the algorithm much more expensive.

SciPy’s function applies iterative dilations with the given structuring element. DIPlib’s function uses a queue-based algorithm that propagates a front. This is much more efficient than the repeated dilations.

If you want to ignore small gaps in this algorithm, you can apply a dilation before the hole filling, and a corresponding erosion after.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by crisluengo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #172 on November 25, 2024 18:42.