SHARE
TWEET

Untitled

a guest Jan 16th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import numpy as np
  2.  
  3. def gaussian_kernel(size, sigma=1):
  4.     size = int(size) // 2
  5.     x, y = np.mgrid[-size:size+1, -size:size+1]
  6.     normal = 1 / (2.0 * np.pi * sigma**2)
  7.     g =  np.exp(-((x**2 + y**2) / (2.0*sigma**2))) * normal
  8.     return g
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top