Skip to content

Instantly share code, notes, and snippets.

@rfmerrill
Created February 24, 2017 15:39
Show Gist options
  • Save rfmerrill/f4aa204f7ad1e6f5099d7a1910e2c5c9 to your computer and use it in GitHub Desktop.
Save rfmerrill/f4aa204f7ad1e6f5099d7a1910e2c5c9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import numpy as np
import os
import cv2
kernel = np.ones((6,6), np.float32)/36.0
while True:
#img = noisy(sys.argv[1], seed)
img = np.random.normal(192, 5, (400,400,1))
cv2.imshow("Noise", np.uint8(img))
img_filtered = cv2.filter2D(img, -1, kernel)
cv2.imshow("Filtered noise", np.uint8(img_filtered))
cv2.waitKey(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment