def METHOD_NAME(img, filt):
    r, s = filt.shape
    assert r % 2 == 1 and s % 2 == 1
    padded = np.pad(img, ((r // 2, r // 2), (s // 2, s // 2)), "reflect")
    return convolve2d(padded, filt, mode="valid")