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

"Input data has unexpected types" - Bug in mahotas.features.lbp.lbp #124

Open
fateh288 opened this issue Sep 6, 2021 · 1 comment
Open

Comments

@fateh288
Copy link

fateh288 commented Sep 6, 2021

Stack Trace -

Traceback (most recent call last):
  File "C:/MS/Courses/CSE 515 MWDB/Project/Phase1/main.py", line 41, in <module>
    elbp.local_binary_pattern(image1)
  File "C:\MS\Courses\CSE 515 MWDB\Project\Phase1\feature_extractor.py", line 66, in local_binary_pattern
    feature = lbp(image, radius=3, points=16)
  File "C:\Users\fateh\anaconda3\envs\Phase1\lib\site-packages\mahotas\features\lbp.py", line 151, in lbp
    codes = lbp_transform(image, radius, points, ignore_zeros=ignore_zeros, preserve_shape=False)
  File "C:\Users\fateh\anaconda3\envs\Phase1\lib\site-packages\mahotas\features\lbp.py", line 75, in lbp_transform
    select(shift(image, [radius*dy,radius*dx], order=1)))
  File "C:\Users\fateh\anaconda3\envs\Phase1\lib\site-packages\mahotas\interpolate.py", line 289, in shift
    _interpolate.zoom_shift(array, None, shift, output, order, mode2int[mode], cval)
RuntimeError: mahotas.zoom_shift: input data has unexpected types. This may be a bug in mahotas.

Code -

from mahotas.features.lbp import lbp
feature = lbp(image, radius=3, points=16)
print(image1.shape)

gives (64, 64) which is as expected (a 2d array)

print(type(image1)) 

gives <class 'numpy.ndarray'> which is as expected (i.e. 2-D numpy ndarray)

@luispedro
Copy link
Owner

Can you perhaps post the image?

What is the dtype (i.e., print(image.dtype)))?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants