-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug in SLIC superpixels with enforce_connectivity=True
and start_label > 0
#6242
Merged
Conversation
This file contains 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
previously it was possible for adjacent to not be assigned leading to occasional outputs with regions labeled as 0 when start_label is > 0
grlee77
added
🩹 type: Bug fix
Fixes unexpected or incorrect behavior
backport: 0.19.x
labels
Feb 9, 2022
rfezzani
approved these changes
Feb 14, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @grlee77, LGTM 😉
@meeseeksdev backport to v0.19.x |
meeseeksmachine
pushed a commit
to meeseeksmachine/scikit-image
that referenced
this pull request
Feb 14, 2022
…rce_connectivity=True` and `start_label > 0`
grlee77
added a commit
that referenced
this pull request
Feb 14, 2022
…2-on-v0.19.x Backport PR #6242 on branch v0.19.x (Fix bug in SLIC superpixels with `enforce_connectivity=True` and `start_label > 0`)
mkcor
reviewed
Feb 14, 2022
|
||
|
||
def test_start_label_fix(): | ||
"""Tests the fix for a bug producing a label < start_label (gh-6240). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
"""Tests the fix for a bug producing a label < start_label (gh-6240). | |
"""Test the fix for a bug producing a label < start_label (gh-6240). |
Sorry for coming late! Thanks for adding this test 😃
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.
Description
closes #6240
Prevent possible 0 label in output when start label > 0 for SLIC superpixels. This could occur when running "_enforce_label_connectivity_cython" because the
adjacent
variable started with value 0, but it seems like it must start withcurrent_new_label
(orstart_label
) to avoid potentially assigning a value outside the label range.This is only really an issue at the upper edge/corner of the image where it is possible that
adjacent
never gets assigned because there are not yet any adjacent labels assigned to pull from.Checklist
./doc/examples
(new features only)./benchmarks
, if your changes aren't covered by anexisting benchmark
For reviewers
later.
__init__.py
.doc/release/release_dev.rst
.example, to backport to v0.19.x after merging, add the following in a PR
comment:
@meeseeksdev backport to v0.19.x
run-benchmark
label. To rerun, the labelcan be removed and then added again. The benchmark output can be checked in
the "Actions" tab.