Open ErinWeisbart opened 1 year ago
This is happening for us too, in the below code on line 53 of calculatemoments.py:
def get_object_moment(pixels, func):
labs = np.unique(pixels)
moms = np.zeros([np.max(labs) + 1, 1])
for l in labs:
if l != 0:
px = pixels[np.where(pixels == l)]
moms[l] = func(px)
return moms
pixels
is an array of floats 0-1, so np.max(labs)
is a float and the np.zeros falls over.
TypeError: 'numpy.float64' object cannot be interpreted as an integer