[SciPy-user] PIL and gaussian_filter?
Sat May 24 02:13:33 CDT 2008
On Sat, May 24, 2008 at 5:39 AM, Robert Kern <firstname.lastname@example.org> wrote:
> On Fri, May 23, 2008 at 9:06 PM, Anne Archibald
> <email@example.com> wrote:
>> 2008/5/22 Johannes Strömberg <firstname.lastname@example.org>:
>>> 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
>>> # 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.
> As I think I've mentioned in another thread, these masked operations
> are inherently slow. We use iterators to do them, and this interferes
> with the ability of the compiler to use optimized instructions. It is
> exactly this operation that was the bottleneck in one of our programs,
> so we wrote a C function using SSE2 instructions to do this wicked
would it be possible, that you could post this
"C function using SSE2 instructions" !?
I'm very curious to see some SSE2. Are you saying the compiler is not
optimizing normal code to use those instructions ?
Lastly, I assume you interface to C using ctypes, right?
More information about the SciPy-user