2d convolution using python and numpy

前端 未结 7 920
鱼传尺愫
鱼传尺愫 2020-12-05 15:48

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          


        
7条回答
  •  醉梦人生
    2020-12-05 16:01

    Try to first round and then cast to uint8:

    data = data.round().astype(np.uint8);
    

提交回复
热议问题