Skip to content
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

incorrect # of sign changes in _local_binary_pattern of _texture.pyx #6538

Open
maxcw opened this issue Sep 23, 2022 · 3 comments
Open

incorrect # of sign changes in _local_binary_pattern of _texture.pyx #6538

maxcw opened this issue Sep 23, 2022 · 3 comments
Labels
😴 Dormant no recent activity

Comments

@maxcw
Copy link

maxcw commented Sep 23, 2022

Description

For v0.19.3 (latest), source code for the _local_binary_pattern function within _texture.pyx appears to have an error when calculating the number of sign changes between patterns. This may be the case for previous versions too. This is for lines 180-183. The loop for calculating 'changes' does not include comparing the first element of signed_texture with the last. It could be fixed by using modular arithmetic.

Way to reproduce

changes = 0
for i in range(P - 1):
    changes += (signed_texture[i]
    signed_texture[i + 1]) != 0

Version information

# Paste the output of the following python commands
scikit-image version: 0.19.3
numpy version: 1.20.3
# your output here
@maxcw
Copy link
Author

maxcw commented Sep 23, 2022

There appears to be an error in the function _local_binary_pattern of _texture.pyx in lines 180-183, when calculating the number of sign changes. The calculation does not include comparing the first element of signed_texture with the last. This could be fixed by increasing the size of the loop by 1 and using modular arithmetic.

I tried posting this in the description but messed up, so it's a comment instead.

@lagru
Copy link
Member

lagru commented Sep 24, 2022

@maxcw, thanks for the report. Could you provide more information so that we can reproduce this? Your version information would probably be useful as well. Note that you can edit the issue description via GitHub's UI as well.

@github-actions
Copy link

Hey, there hasn't been any activity on this issue for more than 180 days. For now, we have marked it as "dormant" until there is some new activity. You are welcome to reach out to people by mentioning them here or on our forum if you need more feedback! If you think that this issue is no longer relevant, you may close it by yourself; otherwise, we may do it at some point (either way, it will be done manually). In any case, thank you for your contributions so far!

@github-actions github-actions bot added the 😴 Dormant no recent activity label Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😴 Dormant no recent activity
Projects
None yet
Development

No branches or pull requests

2 participants