Here's code I use for basic 2d histogramimport numpy as np
def nint (x):
if x >= 0:
return int (x + 0.5)
else:
return int (x - 0.5)
class histogram2d (object):
def __init__ (self, min, max, delta, clip=True):
self.min = min
self.max = max
se
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]/
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],
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*