Let's go back to our holiday in Rome picture. We will add different types of noise to it and then filter the noisy result with our blurring kernels:
Once again, we will start with loading our image:
>> img = imread('holiday_image2.bmp');
Now let's add four kinds of noise to it (we'll use the default settings):
>> gauss = imnoise(img,'gaussian'); >> poiss = imnoise(img,'poisson'); >> speck = imnoise(img,'speckle'); >> snp = imnoise(img,'salt & pepper');
First, we will write a small function that takes the original image, the distorted image, and the type of noise as input; performs filtering with our three filters and displays the results. We'll name our function
DenoiseAndPlot.m
:function DenoiseAndPlot(original,distorted,type) % Function that performs filtering of the distorted image with % three different kernels and displays the results % Inputs: % original - Original image % distorted...