8000 Warning in local binary pattern if image dtype is not integer by anshitag · Pull Request #2563 · scikit-image/scikit-image · GitHub
[go: up one dir, main page]

Skip to content

Warning in local binary pattern if image dtype is not integer #2563

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

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions skimage/feature/texture.py
8000
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from ._texture import (_glcm_loop,
_local_binary_pattern,
_multiblock_lbp)
from warnings import warn


def greycomatrix(image, distances, angles, levels=None, symmetric=False,
Expand Down Expand Up @@ -323,8 +324,13 @@ def local_binary_pattern(image, P, R, method='default'):
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.214.6851,
2004.
"""
if image.dtype.kind not in ('i', 'u'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's only 'u' since positive integers are required.

warn('Image data type incorrect. Convert the image to integer type for'
' local_binary_pattern')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
' local_binary_pattern')
' local_binary_pattern', stacklevel=2)
6162


check_nD(image, 2)


methods = {
'default': ord('D'),
'ror': ord('R'),
Expand Down
0