I want to apply a custom 5x5 filter on image as a part of preprocessing.
Can someone suggest me code.
I have already done
image = np.array(img)
kernel = np.array([[1,4,7,4,1],
kernel = kernel/273
img_rst = cv2.filter2D(np.float32(image),-1,kernel)
new_image = img_rst
x = Image.open("/home/iit/Kapil/Code/DIP/lenna.jpg").convert(‘RGB’)
#img = TF.to_pil_image(x)
transform = transforms.Lambda(HPF)
img = transform(x)
but it does not do any kind of blurring (Gaussian Blurr)