Description
mahotas.convolve(f, weights, mode='reflect', cval=0.0, out={new array})
Convolution of f
and weights
Convolution is performed in doubles to avoid over/underflow, but the result is then cast to f.dtype
. This conversion may result in over/underflow when using small integer types or unsigned types (if the output is negative). Converting to a floating point representation avoids this issue:
c = convolve(f.astype(float), kernel)