PIL Plus / imToolkit replacements

I was trying to find if there was a continuation of the features that were provided for PIL Plus for Python, also known as imToolkit. I know that PIL Plus (aka imToolkit) was a commercial extension for Python. And that it was available to support PIL customers. I also know that the PIL Plus extension is no longer available.

My question is: β€œWere the PIL Plus features / capabilities packaged into any other tools or were they completely ignored?”

What I'm trying to do is repeat what Matlab imfill can do and fill in the β€œholes” to create the best binary image mask.

Thanks for your help in advance.

+3
source share
1 answer

I'm not sure how imfill works. This is true:

 import numpy as np import scipy.ndimage.morphology as morphology bw = np.array([[0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 0, 0], [0, 1, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 1, 0, 0], [0, 1, 1, 1, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]) print(morphology.binary_fill_holes(bw).astype('int')) 

gives

 [[0 0 0 0 0 0 0 0] [0 1 1 1 1 1 0 0] [0 1 1 1 1 1 0 0] [0 1 1 1 1 1 0 0] [0 1 1 1 1 1 0 0] [0 1 1 1 1 0 0 0] [0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0]] 

If so, you can check out the scipy morphology package .

+2
source

All Articles