Skip to content

Instantly share code, notes, and snippets.

@sriharsha0806
Created September 13, 2016 03:22
Show Gist options
  • Save sriharsha0806/7bd8226b471ba9a184d7f11734cc6223 to your computer and use it in GitHub Desktop.
Save sriharsha0806/7bd8226b471ba9a184d7f11734cc6223 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 12 08:44:14 2016
@author: sriharsha
"""
import cv2
from matplotlib import pyplot as plt
img = cv2.imread('Fig0335(a)(ckt_board_saltpep_prob_pt05).tif')
avg_Mask = cv2.blur(img,(3,3))
median = cv2.medianBlur(img,3)
plt.figure(1)
plt.subplot(131),plt.imshow(img),plt.title('Original')
plt.xticks([]),plt.yticks([])
plt.subplot(132),plt.imshow(avg_Mask),plt.title('3X3 averaging mask')
plt.xticks([]),plt.yticks([])
plt.subplot(133),plt.imshow(median),plt.title('3X3 median filter')
plt.xticks([]),plt.yticks([])
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment