How it works...
We started by applying the mean filter to the noisy images with the uniform_filter() function from the scipy.ndimage module. Then, we applied the median filter to the noisy images with median_filer() from the same module. For both the filters, the filter size used was 5, in order to apply a 5 x 5 convolution with the box kernel.
The compare_psnr() function from the skimage.measure module was used to compare the quality of the images denoised using the filters.
The imread() function from the scikit-image.io module was used to read the Lena RGB image and the rgb2gray() function from the scikit-image.color module was used to convert the image to grayscale.
We used either the random_noise() function from the scikit-image.util ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access