import cv2
import numpy as np
from matplotlib import pyplot as plt

img = cv2.imread('Birdy.jpg')
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)

kernel = np.ones((5,5), np.float32)/25
dst = cv2.filter2D(img, -1, kernel)
blur = cv2.blur(img, (5,5))

titles = ['Original image', '2DConvolution', 'Blur']
images = [img, dst, blur]

for i in range(3):
      plt.subplot(1,3,i+1),  plt.imshow(images[i], 'gray')
      plt.title(titles[i])
      plt.xticks([]), plt.yticks([])

plt.show()

