Assuming that you want to normalize within one single image, you can simply use im_out = im_out / im_out.max() * 255
.
You could also normalize kernel or original image.
Example below.
import scipy.signal
import numpy as np
import matplotlib.pyplot as plt
from skimage import color
from skimage import io
im = plt.imread('dice.jpg')
gray_img = color.rgb2gray(im)
print im.max()
# make some kind of kernel, there are many ways to do this...
t = 1 - np.abs(np.linspace(-1, 1, 16))
kernel = t.reshape(16, 1) * t.reshape(1, 16)
kernel /= kernel.sum() # kernel should sum to 1! :)
im_out =scipy.signal.convolve2d(gray_img, kernel, mode = 'same')
im_out = im_out / im_out.max() * 255
print im_out.max()
plt.subplot(2,1,1)
plt.imshow(im)
plt.subplot(2,1,2)
plt.imshow(im_out)
plt.show()
