I am trying to perform a 2d convolution in python using numpy
I have a 2d array as follows with kernel H_r for the rows and H_c for the columns
data
Try to first round and then cast to uint8:
data = data.round().astype(np.uint8);