April 2020
Intermediate to advanced
438 pages
12h 2m
English
We will be using the Lena grayscale image and adding different types of random noise (by drawing random samples from different distributions) to the original image. We will apply a popular linear (mean) and a popular non-linear (median) filter to the noisy images obtained. We will also compare the performance of the filters by computing the peak signal-to-noise ratio (PSNR).
Let's start by loading the requisite libraries with the following code:
%matplotlib inlinefrom skimage.io import imreadfrom skimage.util import random_noisefrom skimage.color import rgb2grayfrom skimage.measure import compare_psnrfrom scipy.ndimage import uniform_filter, median_filterimport numpy as npimport matplotlib.pylab as plt
Read now
Unlock full access