substitute for imsubtract

Josh Warner silvertrumpet999 at gmail.com
Sun Dec 14 19:28:04 EST 2014



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?
>
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20141214/15b4caba/attachment.html>


More information about the scikit-image mailing list