Re: [Numpy-discussion] 2-D Histogram

2013-09-10 Thread josef . pktd
On Tue, Sep 10, 2013 at 9:59 AM, Andreas Hilboll wrote: > On 10.09.2013 15:52, David Reed wrote: >> Hi there, >> >> Is there a faster way to perform a 2D Histogram from a 2D matrix than >> what I have below: >> >> def spatial_histogram(frame, n_bins): >> shape = frame.shape >> >> h_len = shape[0]/

Re: [Numpy-discussion] 2-D Histogram

2013-09-10 Thread Andreas Hilboll
On 10.09.2013 15:52, David Reed wrote: > Hi there, > > Is there a faster way to perform a 2D Histogram from a 2D matrix than > what I have below: > > def spatial_histogram(frame, n_bins): > shape = frame.shape > > h_len = shape[0]/n_bins > w_len = shape[1]/n_bins > > h_ind = range(0, shape[0],

[Numpy-discussion] 2-D Histogram

2013-09-10 Thread David Reed
Hi there, Is there a faster way to perform a 2D Histogram from a 2D matrix than what I have below: def spatial_histogram(frame, n_bins): shape = frame.shape h_len = shape[0]/n_bins w_len = shape[1]/n_bins h_ind = range(0, shape[0], h_len) w_ind = range(0, shape[1], w_len) max_val = 255*h_len*