'RegionProperties' object has no attribute 'feret_diameter_max'

Question:

I’m having some issues with calculating Feret diameter with skimage. All other prop regions (area, centroid, etc.) work fine so I am not sure what the issue is? I’m on Phyton 3.8.3. and skimage 0.17.2

My code looks something like this:

   import skimage.io as io
   import skimage.measure as skmeas
   from skimage.filters import threshold_isodata
   from skimage.color import rgb2gray

   img = io.imread("/home/image.tif")
   img_gray = rgb2gray(img)
   thresh = threshold_isodata(img_gray)
   prediction = img_gray > thresh
   labels = skmeas.label(prediction)
   prop = skmeas.regionprops(labels)
   prop[1].centroid

Out: (3.9571428571428573, 688.5285714285715)

However, when I try to find Feret diameter:

   prop[1].feret_diameter_max

I get an attribute error. : AttributeError: module ‘skimage.io’ has no attribute ‘version

Thanks!

Asked By: coccolith

||

Answers:

feret_diameter_max is new and only available in the development version of scikit-image. It is not present in 0.17. We hope to release it as 0.18 soon. (The error message is strange but probably a red herring…)

Answered By: Juan
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.