substitute for imsubtract
if a = np.array([ [255,10,75], [44, 225, 100]], dtype=np.uint8) b = np.array([ [50, 50, 50],[50, 50, 50] ], dtype=np.uint8) can (a.astype(int) - b.astype(int)).clip(0, 255) be good substitute for imsubtract function? If so or not so, is there a need to have this kind of function in skimage library?
Yes, as far as I’m aware the one-liner you wrote duplicates it. You’ve handled the main issue, namely, wraparound in an unsigned dtype. Still a one-liner. MatLAB holds the user’s hands to a ridiculous degree. We’ve elected not to duplicate the trivial functionality of this as well as a few of the other im_____ functions. @JDWarner On Sunday, December 14, 2014 10:48:11 AM UTC-6, Pratap Vardhan wrote: if
a = np.array([ [255,10,75], [44, 225, 100]], dtype=np.uint8) b = np.array([ [50, 50, 50],[50, 50, 50] ], dtype=np.uint8)
can (a.astype(int) - b.astype(int)).clip(0, 255) be good substitute for imsubtract function? If so or not so, is there a need to have this kind of function in skimage library?
participants (2)
-
Josh Warner
-
Pratap Vardhan