Hello and welcome back. We are going to be using once again,
MATLAB to illustrate what we just learned about answer masking, and a few
additional operations. So, let's go into that.
First we're going to read an image, one of the images that come with the matter
package. Then we're going to add, salt and pepper
noise. We see here point zero nine meaning, that
about 9% of the pixels in the image, are going to be contaminated by salt, white,
or pepper, meaning black noise. After that, we're going to apply to the
noisy image, medium filtering, and we see that operation here.
And then we're going to load, the original image.
The noisy image, the medium filter result, meaning the denoised image. The
difference between these two as one possibility of [INAUDIBLE] masking and
also a stretch histogram. And we're going to see and discuss each
one of these more. So let's just first load all the five
images and see what happens. I'm going to move them around so we can
look at all of them at once. So,
this is once again, we see here first the original image.
Then we see the salt and pepper noise. When the background is white, we can see
the black dots, basically the pepper. When the background is dark, when the
background is dark, we can see the white dots, the salt.
Here we see the result of applying a three by three medium filter to this
image. And we see that we managed to clean the
noise. And we managed to clean pretty much the
whole image. Of course, we have some blurring not a
lot, but some blurring produced by the medium filter.
So it's not exactly the original image. It's kind of a blurred version of it.
Which means that if we take now the difference between these two images,
we're going to get this, which is mostly the edges the basically sharp boundaries
in this image. This image is a bit too dark and
therefore what we do as we know we can stretch the histogram and in this case we
just square the pixel values and by that we are stretching the histogram and we
see here the results. So here is basically, the difference
between the original, the medium filter of the noise filter, that's that and we
have stretching. Now,
observe that we don't see edges, because of the noise.
Those would be superios edges, won't be real edges in the original image.
And that basically happens because we have applied a medium filter before
producing these difference. And that's actually great, because the
medium filter manages to get rid of the noise.
And therefore managed to get rid of the possibility of having superious edges.
So in this example, we see a lot of the things that we have learned.
We see salt and pepper noise, result of medium filter.
The difference producing the most important edges and an histogram
stretching to be able to observe those edges in a much nicer way.
Thank you very much, and see you in the next video.