Add Gaussian Noise To Image Python Numpy

Parameters image ndarray. To bring the data from C to python, I would like to > use ctype. TensorFlow also includes tf. 在matlab中,存在执行直接得函数来添加高斯噪声和椒盐噪声。Python-OpenCV中虽然不存在直接得函数,但是很容易使用相关的函数来实现。. py, which can be downloaded from here. The right-most icon pops up a window which allows you to specify an output file for the plot. So edges are blurred a little bit in this operation. From Google Maps and heightmaps to 3D Terrain - 3D Map Generator Terrain - Photoshop - Duration: 11:35. ) Conversely, widening the Gaussian smoothing component of the operator can reduce some of this noise, but, at the same time, the enhancement effect becomes less pronounced. It applies crops and affine transformations to images, flips some of the images horizontally, adds a bit of noise and blur and also changes the contrast as well as brightness. In the third function you're generating the output signal by adding the frequency components of each signal, but if it's just an additive gaussian noise, you could just add the noise to the signal. Add some noise (e. Write the source code below. The key Python packages you’ll need to follow along are NumPy, the foremost package for scientific computing in Python, Matplotlib, a plotting library, and of course OpenCV. Using Gaussian filter/kernel to smooth/blur an image is a very important tool in Computer Vision. Results are very bad & the overall color of the image is getting altered! Will add the code if needed! So any advice regarding this is much appreciated! May be give me some formulas for adding Noise to the image!. Import the following modules: import cv2 import numpy as np Read the original image: img = cv2. Various icons are displayed at the bottom of the window which allow you to manipulate the plot in various ways such as zooming in, changing the aspect ratio, etc. Clone via HTTPS Clone with Git or checkout with SVN using the repository's web address. Dlib is principally a C++ library, however, you can use a number of its tools from python applications. ndarray (with float dtype) or None, optional PSF kernel array to use for the fine structure image if fsmode == 'convolve'. Hence, many common operations can be achieved using standard NumPy methods for manipulating arrays:. Gaussian process regression (GPR) with noise-level estimation¶ This example illustrates that GPR with a sum-kernel including a WhiteKernel can estimate the noise level of data. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1. Not sure if this is related or not, but you can install multiple versions of Python. Higher order derivatives are not implemented. Install OpenCV and PlantCV. An additive noise autoencoder uses the following equation to add corruption to incoming data: x corr = x + scale*random_normal(n) The following is the detail describe about the preceding equation:. This is often used to reduce the effect of noise in images or to reduce the effect of small registration errors. Thus, by randomly inserting some values in an image, we can reproduce any noise pattern. Though it’s entirely possible to extend the code above to introduce data and fit a Gaussian processes by hand, there are a number of libraries available for specifying and fitting GP models in a more automated way. I wanted to point out some of the python capabilities that I have found useful in my particular application, which is to calculate the power spectrum of an image (for later se. Adding noise works the same way, but instead of adding a fixed value to every pixel you add normal distributed values. Add some human noise (typos, things in the wrong boxes etc. util import random_noise im = random_noise(im, var=0. The code is in python and you need to have openCV, numpy and math modules installed. So, let's discuss Image Processing with SciPy and NumPy. It is the formula for an LoG operator which is a double derivative over an image (gaussian smoothed to remove noise which gets immensely enhanced by double derivative). The Python Software Foundation ("PSF") does not claim ownership of any third-party code or content ("third party content") placed on the web site and has no obligation of any kind with respect to such third party content. we generally use a filter like the Gaussian Filter, which is a digital filtering technique that is often used to remove noise from an image. Denoising an image with the median filter¶. You can vote up the examples you like or vote down the ones you don't like. It is quite simple. This is why the numpy module introduces a new data type, , which does allow such operations. However derivates are also effected by noise, hence it’s advisable to smooth the image first before taking the derivative. We will deal with reading and writing to image and displaying image. by Kardi Teknomo. Hi Everyone! I have been trying to add Additive White Gaussian Noise in my Mat image(Using Qt 5. #!/usr/bin/env python from numpy import * import Gnuplot """ Demonstrates how to use gnuplot for graphs. The sharp change is edge. In statistics, a mixture model is a probabilistic model for density estimation using. Disini saya menggunakan python untuk menggunakan metode ini tentunya menggunakan opencv sebagai library nya. mode str, optional. Getting Started¶. An order of 1, 2, or 3 corresponds to convolution with the first, second or third derivatives of a Gaussian. shape noise = np. Manipulating brightness works like this: you need a numpy array with the size of the image, add your brightness and add the brightness array to the original image. Will be converted to float. In this tutorial, we'll be covering image gradients and edge detection. Gaussian noise is characterized by adding to each image pixel a value from a zero-mean Gaussian distribution. We will not use any real data here, but simulate simple data to see how well we can fit the data. Python OpenCV package provides ways for image smoothing also called blurring. This blur technique can be used using the medianBlur function. Typically, the form of the objective. randn(d0, d1, …, dn) : creates an array of specified shape and fills it with random values as per standard normal distribution. It has three ‘special’ input params and only one output argument. To smoothe noise and the edges, we use a Gaussian filter:. 04 alongside Windows 10 (dual boot) How to create a cool cartoon effect with OpenCV and Python How to create a beautiful pencil sketch effect with OpenCV and Python 12 advanced Git commands I wish my co-workers would know How to classify iris species using logistic regression. gaussian_filter lets you choose from several different assumptions, and I find one of these is usually closer to my needs than assuming zeros. Image filters can be used to reduce the amount of noise in an image and to enhance the edges in an image. For pixels with probability value in the range (0, d /2), the pixel value is set to 0. The larger sigma spreads out the noise. We’ll perform the following steps: Read in the 2D image. Frequency response of the output image. mode : str, optional: One of the following strings, selecting the type of noise to add: - 'gaussian' Gaussian-distributed additive noise. TestCase class. OpenCV is a highly optimized library with focus on real-time applications. Since derivative filters are very sensitive to noise, it is common to smooth the image (e. This is the type we're going to work on with OpenCV in this chapter!. x are supported, and the package should work correctly on Linux, MacOS X, and Windows. The array element’s datatype is determined in a way which is supposed to work both for numpy arrays and for Python array. , 20% of noise) Try two different denoising methods for denoising the image: gaussian filtering and median filtering. Here grImage is my original grayscale image, double spinbox s_Dev gives the value of the variance defined by the user, and mult is the array of gaussian random nos. Performing Fits and Analyzing Outputs¶. Standard deviation is a measure of how spread out the values are from the mean or 0. In this Python tutorial, we will use Image Processing with SciPy and NumPy. normal(loc = 0. Why is this Difference Important? There is the risk is that you use the common knowledge that Poisson noise approaches Gaussian noise for large numbers, and then simply add Gaussian noise with a fixed variance to the original image. Copy an image to folder project. electronic circuit noise. I see people asking an algorithm for skeletonization very frequently. Almost all image processing tools today, provides features on histogram. Some images from the Gaussian Pyramid. However, I am not planning on putting anything into production. The following are code examples for showing how to use keras. 1) The next figures show the noisy lena image, the blurred image with a Gaussian Kernel and the restored image with the inverse filter. Seitz Gaussian noise Mathematical model: sum of many independent factors Good for small standard deviations Assumption: independent, zero-mean noise Source: K. Hence, when you do convolution with a constant input, you should expect 0 at output and not the same constant value (double derivative of constant is 0). datasets import mnist from keras. Image Fisher Vectors In Python Although the state of the art in image classification (while writing this post) is deep learning, Bag of words approaches still perform well on many image datasets. So, this was all about Generating Python Random Number. Some of the operations covered by this tutorial may be useful for other kinds of multidimensional array processing than image processing. Once you have conda and git or GitHub Desktop installed, clone the PlantCV repository, open a command-line terminal application (on Windows there are other options but for this tutorial we will use the Anaconda Prompt application). I ended up treating the spectrogram as an image and using the image processing toolkit and techniques from scipy to find peaks. The infinitesimal step of a Brownian motion is a Gaussian random variable. NumPy has the sin() function, which takes an array of values and provides the sine value for them. This article will go into a bit of the background of FSK and demonstrate writing a simulator in Python. Clustering with Gaussian Mixture Models. Useful when you want to customise the layout of the widgets yourself. 4 of the image. The probability density function of the normal distribution, first derived by De Moivre and 200 years later by both Gauss and Laplace independently , is often called the bell curve because of its characteristic shape (see the example below). You really have to generate 3 of these arrays, 3 different noise matrices, to add each to RGB image components respectively. The larger sigma spreads out the noise. 2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. We're going to extract it, create a GMM, run the EM. But it still simply mixes the noise into the result and smooths indiscriminately across edges. Input image data. OpenCV package for Python is successfully installed. Note that it should be three dimensional array even if it is a gray image data. Codebox Software Image Augmentation for Machine Learning in Python machine learning open source python. Using Numpy. If a time series is white noise, it is a sequence of random numbers and cannot be predicted. randn() to get random values within the Gaussian distribution. So far I tried to understand how to define a 2D Gaussian function in Python and how to pass x and y variables to it. Create a binary image (of 0s and 1s) with several objects (circles, ellipses, squares, or random shapes). poisson noise was new as of MATLAB R12+, Image Processing Toolbox version 3. Image sharpening¶. Mostrar el array de la imagen usando matlplotlib. Inconsistency between gaussian_kde and density integral sum. It will be more visible when you add two images. Additive gradient descent Image from Original Paper. It computes the Laplacian of Gaussian images with successively increasing standard deviation and stacks them up in a cube. Because of this limitation of integer. In this tutorial, you will discover white noise time series with Python. matplotlib. The following figures show the outputs:. , noise_sigma, input. この節は、科学技術計算コアモジュールである Numpy や Scipy を利用した画像に対する基本的な操作と処理について扱います。. Typically, the form of the objective. Typically, the form of the objective. Here grImage is my original grayscale image, double spinbox s_Dev gives the value of the variance defined by the user, and mult is the array of gaussian random nos. Since images are discrete in nature, we can easily take the derivate of an image using 2D derivative mask. OpenCV 3 image and video processing with Python OpenCV 3 with Python Image - OpenCV BGR : Matplotlib RGB Basic image operations - pixel access iPython - Signal Processing with NumPy Signal Processing with NumPy I - FFT and DFT for sine, square waves, unitpulse, and random signal Signal Processing with NumPy II - Image Fourier Transform : FFT & DFT. The standard random module implements a random number generator. Let’s work on a simple example. We will deal with reading and writing to image and displaying image. Histogram with Plotly Express¶. Add some random noise to the Lena image. A 2d Gaussian fit is done on each of the maxima constraining the position on the subimage and the sigma of the fit. On to some graphing of what we have till now. The purpose of frequency shift keying (FSK) is to modulate digital signals so they can be transmitted wirelessly. Take an image, add Gaussian noise and salt and pepper noise, compare the effect of blurring via box, Gaussian, median and bilateral filters for both noisy images, as you change the level of noise. Will be converted to float. import matplotlib. Results are very bad & the overall color of the image is getting altered! Will add the code if needed! So any advice regarding this is much appreciated! May be give me some formulas for adding Noise to the image!. 이미지의 Gaussian Noise (전체적으로 밀도가 동일한 노이즈, 백색노이즈)를 제거하는 데 가장 효과적입니다. Python In Greek mythology, Python is the name of a a huge serpent and sometimes a dragon. This is well illustrated by this simulation of a zombie outbreak in France (inspired by this blog post by Max Berggren). For creating a transparent image you need a 4 channel matrix, 3 of which would represent RGB colors and the 4th channel would represent Alpha channel, To create a transparent image, you can ignore the RGB values and directly set the alpha channel. In this case, we will use NumPy library to implement linear regression, one of the simplest machine learning models. Python lmfit: Fitting a 2D Model I'm trying to fit a 2D-Gaussian to some greyscale image data, which is given by one 2D array. KRR learns a linear function in the space induced by the respective kernel which corresponds to a non-linear function in the original space. This page documents the python API for working with these dlib tools. NumPy, a fundamental package needed for scientific computing with Python. Crop to remove all black rows and columns across entire image. To smoothe noise and the edges, we use a Gaussian filter:. I wanted to point out some of the python capabilities that I have found useful in my particular application, which is to calculate the power spectrum of an image (for later se. Practical coverage of every image processing task with popular Python libraries Includes topics such as pseudo-coloring, noise smoothing, computing image descriptors. pyplot as plt from numpy import loadtxt import numpy as np from pylab add some noise to the test images. I now need to calculate kernel values for each combination of data points. In the spirit of this workshop let's jump in to real Python analysis code. Will be converted to float. Since edge detection is susceptible to noise in the image, the first step is to remove the noise in the image with a 5x5 Gaussian filter. Then, the outlier points are added to the data set. The data and model used in this example are defined in createdata. While noise can come in different flavors depending on what you are modeling, a good start (especially for this radio telescope example) is Additive White Gaussian Noise (AWGN). The labels are numbers between 0 and 9 indicating which digit the image represents. scikit-image is an image processing library that implements algorithms and utilities for use in research, education and industry applications. Then, the routine will choose a centroid, mu, and variance (or mus and variances). randn(100, 1) # y = 4 + 3X + Gaussian noise. Averaging images is a simple way of reducing image noise and is also often used for artistic effects. See also Stheno. Function to add random noise of various types to a floating-point image. Using Numpy. この節は、科学技術計算コアモジュールである Numpy や Scipy を利用した画像に対する基本的な操作と処理について扱います。. How to Create Noise Image Processing Quick and Easy Solution Create Noise in Matlab, In the next video noise reduction in image processing and noise filter image processing. Median Blur can be used to minimize noise effects on the image. Hence, when you do convolution with a constant input, you should expect 0 at output and not the same constant value (double derivative of constant is 0). It will be more visible when you add two images. Not sure if this helps, it depends on the signal-to-noise ratio: If you can clearly distinguish the noise from the signal in the spectrum (something similar as in the second figure of the Noisy Signal example in Matlab's documentation of the fft), you could set a threshold and make the spectrum with an amplitude below that threshold equal to. The code is in python and you need to have openCV, numpy and math modules installed. rand(target_dims) noisy_target = your_target + noise Now use the noisy_target as input to your model. Crop to remove all black rows and columns across entire image. They are extracted from open source Python projects. GaussianBlur, cv2. We next add Gaussian-distributed noise with per channel to the spectra (in observed space) to mimic real observational noise from the Millenium survey (Heiles & Troland 2003), and re-sample the data at to avoid aliasing the narrowest components (with FWHMs of ) in the training set. Similar to first-order, Laplacian is also very sensitive to noise; To reduce the noise effect, image is first smoothed with a Gaussian filter and then we find the zero crossings using Laplacian. Gaussian Mixture Models ¶. Let's work on a simple example. نویز گاوسی چیه؟ ایجاد نویز گوسی و افزودن آن به تصویر در Python: الان که تعریف نویز و نویز گاوسی رو می‌دونیم برنامه نویسی بخش ساده‌ی کارمونه. We are jumping from one package to the next, calling mahotas to filter the image and to compute the threshold, using numpy operations to create a thresholded images, and pylab to display it, but everyone works with numpy arrays. jpg') #create a matrix of one's, then multiply it by a scaler of 100' #np. This paper demonstrates basic computer vision examples using SciPy, OpenCV and Pygame. In the image above, , I've saved some data in a numpy array. This study requires listing all the image augmentations we can think of and enumerating all of these combinations to try and improve the performance of an image classification model. wav (an actual ECG recording of my heartbeat) exist in the same folder. Or, how to add noise to an image using Python with OpenCV?. The NumPy module uses a machine's natural number types to represent the data values, so a NumPy array can consist of integers that are 8-bits, 16-bits, and 32-bits. I now need to calculate kernel values for each combination of data points. I tried to scale the image to [0 1] to, but the result is not different. njit function within which I am trying to put an integer within a string array. NumPy/SciPy and. Performs Non-maximum Suppression - very important algorithm also used in DNN Object Detection algorithms. You can add several builtin noise patterns, such as Gaussian, salt and pepper, Poisson, speckle, etc. It means that for each pixel location in the source image (normally, rectangular), its neighborhood is considered and used to compute the response. The encoding process repeats the following: multiply the current total by 17 add a value (a = 1, b = 2, , z = 26) for the next letter to the total So at. They are extracted from open source Python projects. Almost all image processing tools today, provides features on histogram. Now you know how to generate random numbers in Python. Will be converted to float. The following python code can be used to add Gaussian noise to an image: from skimage. One of the following strings, selecting the type of noise to add: 'gaussian' Gaussian-distributed additive noise. GaussianBlur() function. That being said, this really isn't going to be a primer on Perlin Noise itself, rather it's going to focus on its implementation in Python. so we're adding some noise to scatter them or create some deviation. Next Previous. py --image /magepath/image. Add some random noise to the Lena image. As I mentioned earlier, this is possible only with numpy. Finds Intensity Gradient of the Image. Example Program: Create new Python file on your PYCharm with name median-blur. This prints a random floating point number in the range [0, 1) (that is, between 0 and 1, including 0. Depends on your model of noise. Python lmfit: Fitting a 2D Model I'm trying to fit a 2D-Gaussian to some greyscale image data, which is given by one 2D array. Will be converted to float. Averaging images is a simple way of reducing image noise and is also often used for artistic effects. A implementation of canny edge detection algorithm in python using numpy and opencv. We need to make sure that the data plot isn't a glorious line, so we're adding some noise to scatter them or create some deviation. They are extracted from open source Python projects. Image set from a numpy matrix if input was an image or a numpy matrix otherwize. Almost all image processing tools today, provides features on histogram. Random Gaussian noise models real world noise well enough. from __future__ import print_function import datetime import keras from keras. # For 50% of all images, we sample the noise once per pixel. Parameters ----- image : ndarray Input image data. normal(mean, sigma, (. by changing the 'mode' argument. SciPy Cookbook¶. However, if the above two methods aren't what you are looking for, you'll have to move onto option three and "roll-your-own" distance function by implementing it by hand. How to Create Noise Image Processing Quick and Easy Solution Create Noise in Matlab, In the next video noise reduction in image processing and noise filter image processing. This post describes how to make (almost) any Instagram filter with about 15 lines of Python, using the (now-defunct) Gotham Instagram filter as a case study. Now you know how to generate random numbers in Python. Some of the operations covered by this tutorial may be useful for other kinds of multidimensional array processing than image processing. I've attempted to do this with scipy. Global optimization is a challenging problem of finding an input that results in the minimum or maximum cost of a given objective function. Will be converted to float. It is also a Gaussian Mixture-based Background/Foreground Segmentation Algorithm. نویز گاوسی چیه؟ ایجاد نویز گوسی و افزودن آن به تصویر در Python: الان که تعریف نویز و نویز گاوسی رو می‌دونیم برنامه نویسی بخش ساده‌ی کارمونه. import numpy as np. import numpy as np import imgaug as ia import imgaug. This blur technique can be used using the medianBlur function. This page tries to provide a starting point for those who want to work with audio in combination with Python. Take an image, add Gaussian noise and salt and pepper noise, compare the effect of blurring via box, Gaussian, median and bilateral filters for both noisy images, as you change the level of noise. 运行上面代码,可得P002 Figure 1-1中出现的所有实例图,结果如下: 1. MatPlotLib Tutorial. See the white patch on the left side of the apple. As part of our short course on Python for Physics and Astronomy we will look at the capabilities of the NumPy, SciPy and SciKits packages. "Principal sources of Gaussian noise in digital images arise during acquisition eg. With normal Python, you’d have to for loop or use list comprehensions. From your code I can see where my faults are. Algorithms The mean and variance parameters for 'gaussian' , 'localvar' , and 'speckle' noise types are always specified as if the image were of class double in the range [0, 1]. Linear Data Smoothing in Python November 17, 2008 Scott Leave a comment General , Python Warning : This post is several years old and the author has marked it as poor quality (compared to more recent posts). Python lmfit: Fitting a 2D Model I'm trying to fit a 2D-Gaussian to some greyscale image data, which is given by one 2D array. In this tutorial, we'll be covering image gradients and edge detection. Noisy image is generated by adding random noise to reference noise-free image. import numpy as np. normal¶ numpy. Index Terms— Additive Gaussian noise, Image Denoising, Nonlinear Filter, Noise Variance, Standard Deviation and Smoothing Factor I. Examples¶ The next sections contains some examples showing ways to use PyNIfTI to read and write imaging data from within Python to be able to process it with some random Python library. On to some graphing of what we have till now. Hysteresis Thresholding. Gaussian noise are values generated from the normal distribution. Gaussian and Gaussian-Like There may be occasions when you are working with a non-Gaussian distribution, but wish to use parametric statistical methods instead of nonparametric methods. Building with ``python setup. Write the source code below. This is the type we're going to work on with OpenCV in this chapter!. OK, I Understand. Restore the image using inverse filter. This is often used to reduce the effect of noise in images or to reduce the effect of small registration errors. Blurring is often used as a first step before we perform Thresholding, Edge Detection, or before we find the Contours of an image. The infinitesimal step of a Brownian motion is a Gaussian random variable. poisson(noisemap) Then you can crop the result to 0 - 255 if you like (I use PIL so I use 255 instead of 1). Next, we are going to use the trained Naive Bayes ( supervised classification ), model to predict the Census Income. Denoising an image with the median filter¶. In statistics, a histogram is representation of the distribution of numerical data, where the data are binned and the count for each bin is represented. Zivkovic, “Improved adaptive Gausian mixture model for background subtraction” in 2004 and “Efficient Adaptive Density Estimation per Image Pixel for the Task of Background Subtraction” in 2006. AdditiveLaplaceNoise(L, S, PCH) Adds noise sampled from a laplace distribution following Laplace(L, S) to images. legend() pylab. Frequency response of the output image. In OpenCV, image smoothing (also called blurring) could be done in many ways. To do this, we will require two images of equal size to start, then later on a smaller image and a larger. By convention, we will import numpy as np. 2: Moved to the version 2 scheme which uses all of the bits in a string seed. There are two types of noise that can be present in an image: speckle noise and salt-and-pepper noise. Trent Hare (thare@usgs. Notes Links How to add metadata to a data frame with pandas in python ? avec numpy et python ? Type: article Added by Daidalos on October 16, 2019. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions. The right-most icon pops up a window which allows you to specify an output file for the plot. To smoothe noise and the edges, we use a Gaussian filter:. Comparison of kernel ridge and Gaussian process regression¶ Both kernel ridge regression (KRR) and Gaussian process regression (GPR) learn a target function by employing internally the “kernel trick”. There are many applications for taking fourier transforms of images (noise filtering, searching for small structures in diffuse galaxies, etc. normal is more likely to return samples lying close to the mean, rather than those far away. Elegant NumPy: The Foundation of Scientific Python [NumPy] is everywhere. This way you can avoid the clutter of bitmap files generated by PIL and left behind in your \Local Settings\Temp folder. Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately. Should be equal to the S in the shape of the numpy arrays as for instance documented in scatter or plot_mesh. Key Features. Gaussian noise are values generated from the normal distribution. You really have to generate 3 of these arrays, 3 different noise matrices, to add each to RGB image components respectively. kaiser(101,b) pylab. of Channels & Type of Image OpenCV C++. Depends on your model of noise. If PCH is true, then the sampled values may be different per channel (and pixel). You can vote up the examples you like or vote down the ones you don't like. Function File: imnoise (A, "gaussian", mean, variance) Additive gaussian noise with mean and variance defaulting to 0 and 0. Other channels stay unchanged. Many high quality online tutorials, courses, and books are available to get started with NumPy. , 20% of noise) Try two different denoising methods for denoising the image: gaussian filtering and median filtering. py The sample demonstrates how to train Random Trees classifier (or Boosting classifier, or MLP, or Knearest, or Support Vector Machines) using the provided dataset. You could also generate the linear SNR from your SNR in decibels, I've used this function in one of my projects once:. The code supports 1D, 2D and 3D noise it should be fairly easy to extend it to higher dimensions. The deprecated functions ``fprob``, ``ksprob``, ``zprob``, ``randwcdf`` and ``randwppf`` have been removed from `scipy. mode : str One of the following strings, selecting the type of noise to add: 'gauss' Gaussian-distributed additive noise. poisson noise was new as of MATLAB R12+, Image Processing Toolbox version 3. It basically smoothes the image by convolving with a Gaussian. Blurring an image with a two-dimensional FFT Note that there is an entire SciPy subpackage, scipy. This is why the numpy module introduces a new data type, , which does allow such operations. Seems like stackoverflow would be a better place to ask this, but without more detail I would say that numpy. gaussian_filter taken from open source projects. An introduction to computer vision in Python, from the general concept to its implementa-tion with some current open-source libraries.