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

image = cv2.imread('couleur.png')
bilateral = cv2.bilateralFilter(image, 5, 75, 75)
blur = cv2.blur(image, (5, 5))
box = cv2.boxFilter(image, -1, (5, 5))
DD = cv2.filter2D(image, -1, (5, 5))
gaussian = cv2.GaussianBlur(image, (5, 5), 50)
median = cv2.medianBlur(image, 5)
sep = cv2.sepFilter2D(image, -1, 75, 75)

kernel = np.array([[-1,-1,-1], [-1,9,-1], [-1,-1,-1]])
im = cv2.filter2D(image, -1, kernel)
bilateral2 = cv2.bilateralFilter(im, 5, 150, 150)

plt.subplot(2,3,1),plt.imshow(image)
plt.title('Original'), plt.xticks([]), plt.yticks([])
plt.subplot(2,3,2),plt.imshow(bilateral)
plt.title('Bilateral Filter'), plt.xticks([]), plt.yticks([])
plt.subplot(2,3,3),plt.imshow(blur)
plt.title('Blur'), plt.xticks([]), plt.yticks([])
plt.subplot(2,3,4),plt.imshow(box)
plt.title('Box Filter'), plt.xticks([]), plt.yticks([])
plt.subplot(2,3,5),plt.imshow(gaussian)
plt.title('Gaussian Filter'), plt.xticks([]), plt.yticks([])
plt.subplot(2,3,6),plt.imshow(median)
plt.title('Median Blur'), plt.xticks([]), plt.yticks([])
plt.show()

cv2.imshow('Sharp', im)
cv2.imshow('Bilateral', bilateral2)
#cv2.imshow('original', image)
#cv2.imshow('bilateral filter', bilateral)
#cv2.imshow('blur', blur)
#cv2.imshow('box', box)
#cv2.imshow('filter 2D', DD)
#cv2.imshow('gaussian filter', gaussian)
#cv2.imshow('median blur', median)
#cv2.imshow('sep Filter 2D', sep)

cv2.waitKey(0)
cv2.destroyAllWindows()
