[SciPy-user] PIL and gaussian_filter?

Anne Archibald peridot.faceted@gmail....
Fri May 23 21:06:49 CDT 2008


2008/5/22 Johannes Strömberg <johannes.stromberg@gmail.com>:
> Thank you everyone,
>
> Unfortunately I was wrong about the calculations I actually need to
> perform. I have got a working set of operations for what I need (see
> below), but it is awfully slow. Anybody got any idea on how to make it
> faster?
>
> # in = array
> # gaussian = array
> # threshold = int
> # percent = int
>
> diff = in - gaussian
> diff = numpy.where(diff > threshold,diff,0)

It might help a little to write:
diff[diff>threshold] = 0

Otherwise there's not too much fat in there.

Anne


More information about the SciPy-user mailing list