Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot import name 'graycomatrix' from 'skimage.feature'

I have successfully installed skimage packages but when I try to import the

from skimage.feature import graycomatrix, graycoprops

it results in an error saying:

cannot import name 'graycomatrix' from 'skimage.feature' (/Users/ain/opt/anaconda3/lib/python3.8/site-packages/skimage/feature/__init__.py)
like image 287
Ain' Natasha Mohd Nasir Avatar asked Apr 20 '26 19:04

Ain' Natasha Mohd Nasir


2 Answers

Its name is greycomatrix. Syntax is

from skimage.feature import greycomatrix, greycoprops
like image 59
Prasanth Avatar answered Apr 22 '26 09:04

Prasanth


To be more precise, to answer @smcs's comment and to update the accepted answer, from version 0.19 as seen in this pull request the functions are named graycomatrix and graycoprops and the documentation (github and docs) and the tutorial are correct.

To sum up. For skimage version 0.19 and above, this is the right import and version:

from skimage.feature import graycomatrix, graycoprops

and for older versions (but also till version 1.0 as mentioned in this issue) holds @Prasanth's answer:

from skimage.feature import greycomatrix, greycoprops
like image 38
My Work Avatar answered Apr 22 '26 08:04

My Work



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!