I want to fill the central spot in this image, so that at the end that is white and the rest is black. I am trying to do it using ndimage.binary_fill_holes
(code below). When I run my script, I get the error 'NoneType' object has no attribute 'astype'
. What should I do to fix this?
mask_filled = np.array(mask,numpy.uint16)
ndimage.binary_fill_holes(mask_2, structure=np.ones((dim_x,dim_y)), origin=(75,75), output=mask_2_filled).astype(int)
np.savetxt(filename_filled, mask_filled, fmt='%i')