[SciPy-user] PIL and gaussian_filter?

Angus McMorland amcmorl@gmail....
Wed May 21 16:01:10 CDT 2008

2008/5/21 Johannes Strömberg <johannes.stromberg@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