.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_packages_scikit-image_auto_examples_plot_filter_coins.py: Various denoising filters ========================= This example compares several denoising filters available in scikit-image: a Gaussian filter, a median filter, and total variation denoising. .. image:: /packages/scikit-image/auto_examples/images/sphx_glr_plot_filter_coins_001.png :class: sphx-glr-single-img .. code-block:: python import numpy as np import matplotlib.pyplot as plt from skimage import data from skimage import filters from skimage import restoration coins = data.coins() gaussian_filter_coins = filters.gaussian(coins, sigma=2) med_filter_coins = filters.median(coins, np.ones((3, 3))) tv_filter_coins = restoration.denoise_tv_chambolle(coins, weight=0.1) plt.figure(figsize=(16, 4)) plt.subplot(141) plt.imshow(coins[10:80, 300:370], cmap='gray', interpolation='nearest') plt.axis('off') plt.title('Image') plt.subplot(142) plt.imshow(gaussian_filter_coins[10:80, 300:370], cmap='gray', interpolation='nearest') plt.axis('off') plt.title('Gaussian filter') plt.subplot(143) plt.imshow(med_filter_coins[10:80, 300:370], cmap='gray', interpolation='nearest') plt.axis('off') plt.title('Median filter') plt.subplot(144) plt.imshow(tv_filter_coins[10:80, 300:370], cmap='gray', interpolation='nearest') plt.axis('off') plt.title('TV filter') plt.show() **Total running time of the script:** ( 0 minutes 0.118 seconds) .. _sphx_glr_download_packages_scikit-image_auto_examples_plot_filter_coins.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: plot_filter_coins.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_filter_coins.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_