[SciPy-user] PIL and gaussian_filter?

Angus McMorland amcmorl at gmail.com
Wed May 21 17:01:10 EDT 2008


2008/5/21 Johannes Strömberg <johannes.stromberg at gmail.com>:
> Does anyone know of an efficient way of implementing a threshold
> filter, i.e. where the resulting value is either the difference
> between the current value and the threshold (if the value is above the
> threshold) or otherwise 0?

How about:

filtered = np.where(img > thr, img - thr, 0)

?
-- 
AJC McMorland, PhD candidate
Physiology, University of Auckland

(Nearly) post-doctoral research fellow
Neurobiology, University of Pittsburgh



More information about the SciPy-User mailing list