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

Error in using the Zernike moments. #126

Open
M-I-Dx opened this issue Nov 8, 2021 · 6 comments
Open

Error in using the Zernike moments. #126

M-I-Dx opened this issue Nov 8, 2021 · 6 comments

Comments

@M-I-Dx
Copy link

M-I-Dx commented Nov 8, 2021

I am trying to get Zernike moments for some images but I keep getting the following error

AttributeError                            Traceback (most recent call last)
<ipython-input-33-6eb9b0e4463a> in <module>()
----> 1 get_moments(img, 10)

<ipython-input-32-b3923b47676f> in get_moments(image, radius)
      1 def get_moments(image, radius):
----> 2     moments = mahotas.features.zernike_moments(image, radius)
      3     return moments

AttributeError: module 'mahotas' has no attribute 'features'

Can you suggest the fix for this?

@luispedro
Copy link
Owner

What does your file look like? Did you import mahotas.features before this code?

@M-I-Dx
Copy link
Author

M-I-Dx commented Nov 8, 2021

If I import mahotas.features instead of just mahotas, I get the following error:

/usr/local/lib/python3.7/dist-packages/mahotas/features/__init__.py in <module>()
      4 #
      5 
----> 6 from .texture import haralick
      7 from .tas import tas, pftas
      8 from .zernike import zernike, zernike_moments

/usr/local/lib/python3.7/dist-packages/mahotas/features/texture.py in <module>()
      6 
      7 import numpy as np
----> 8 from . import _texture
      9 from ..internal import _verify_is_integer_type
     10 

ImportError: numpy.core.multiarray failed to import

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

@luispedro
Copy link
Owner

Does import numpy work on your system? This is some messed up installation. How did you install mahotas?

@M-I-Dx
Copy link
Author

M-I-Dx commented Nov 8, 2021

Yes, import numpy works. I am running it on google colabs. For installing mahotas, I just used pip install mahotas.

@luispedro
Copy link
Owner

Sorry, this seems like a messed up environment and I do not have any insights.

@M-I-Dx
Copy link
Author

M-I-Dx commented Nov 8, 2021

Ok. Thanks for your time. I will try it on my local system.

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