Created
October 20, 2022 15:33
-
-
Save victormurcia/dd92cefa9553827b8f94c590bfc8fc4c to your computer and use it in GitHub Desktop.
blurring images
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| params = [(3, 20, 5, 5), (9, 20, 40, 20), (15, 20, 160, 60)] | |
| fig,axs = plt.subplots(4, 3, figsize=(30,30)) | |
| i = 0 | |
| for (k, diameter, sigmaColor, sigmaSpace) in params: | |
| simpleblur_image = cv2.blur(rgb_img, (k,k)) | |
| gaussblur_image = cv2.GaussianBlur(rgb_img, (k,k), 0) | |
| medianblur_image = cv2.medianBlur(rgb_img, k) | |
| bilateralblur_image = cv2.bilateralFilter(rgb_img, diameter, sigmaColor, sigmaSpace) | |
| axs[0,i].imshow(simpleblur_image) | |
| axs[1,i].imshow(gaussblur_image) | |
| axs[2,i].imshow(medianblur_image) | |
| axs[3,i].imshow(bilateralblur_image) | |
| i+=1 | |
| #Plot results | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment