Complete inner grain boundaries with anchored shortest paths - #2575
Draft
ralfHielscher wants to merge 14 commits into
Draft
ralfHielscher wants to merge 14 commits into
ralfHielscher wants to merge 14 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
completeBoundariesflag tocalcGrainsminPixel, and isolated-pixel-loop regression casesMotivation
Connected-component reconstruction can merge otherwise distinct grains when only one sub-threshold neighboring pixel pair bridges them. The detected interfaces then remain as self-boundaries inside the merged grain.
An unconstrained pixel minimum cut tends to isolate a single boundary pixel because that is often the cheapest cut. Boundary completion is therefore performed in the planar dual graph instead: retained boundary chains are extended along Voronoi segments until the resulting network is anchored at non-inner boundaries.
Loop prevention
For each free boundary endpoint, admissible targets are either:
All other vertices of the active boundary network are blocked while finding the path. Consequently, an added path cannot connect a boundary component back to itself and cannot close a new loop around an isolated pixel. Once different components are joined, their remaining free ends are still extended until the complete network terminates at non-inner boundaries.
Performance
minPixelpass, so completion is not run twiceThe path sequence is greedy: every augmentation uses the smallest currently available number of new segments, but the complete result is not claimed to be a globally optimal Steiner forest.
Compatibility
Default reconstruction is unchanged unless
completeBoundariesis supplied. One- and two-segment enclosed fragments are removed as noise; equally short fragments touching a pre-existing non-inner boundary are retained.Validation