Skip to content

Instantly share code, notes, and snippets.

@rfmerrill
Created February 24, 2017 15:39
Show Gist options
  • Select an option

  • Save rfmerrill/f4aa204f7ad1e6f5099d7a1910e2c5c9 to your computer and use it in GitHub Desktop.

Select an option

Save rfmerrill/f4aa204f7ad1e6f5099d7a1910e2c5c9 to your computer and use it in GitHub Desktop.

Revisions

  1. rfmerrill created this gist Feb 24, 2017.
    14 changes: 14 additions & 0 deletions noise.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/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)