A-level Physics (Advancing Physics)/Digital Processing

As we have already seen, a digital image consists of pixels, with each pixel having a value which represents its colour. For the purposes of understanding how digital images are manipulated, we are going to consider an 8-bit grayscale image, with pixel values ranging from 0 to 255, giving us 256 (28) levels of grey. 0 represents white, and 255 represents black. This is the image we are going to consider:

The image consists of an edge, and some random noise. There are two methods of smoothing this image (i.e. removing noise) that you need to know about:

Mean Smoothing
In order to attempt to remove noise, we can take the mean average of all the pixels surrounding each pixel (and the pixel itself) as the value of the pixel in the smoothed image, as follows:

This does remove the noise, but it blurs the image with means crucial anomalies and points may be missed.

Median Smoothing
A far better method is, instead of taking the mean, to take the median, as follows:

For this image, this gives a perfect result. In more complicated images, however, data will still be lost, although, in general, less data will be lost by taking the median than by taking the mean.

Edge Detection
We can detect the positioning of edges in an image using the 'Laplace rule', or 'Laplace kernel'. For each pixel in the image, we multiply its value by 4, and then subtract the values of the pixels above and below it, and on either side of it. If the result is negative, we treat it as 0. So, taking the median-smoothed image above, edge detection gives the following result:

Questions
1. How could the above methods be applied to a digital sound sample?

2. Which of the above methods would be suitable for smoothing sharp edges? Why?

3. Use median smoothing to remove noise from the following image of a white cat in a snowstorm (the black pixels have a value of 255):

4. Why would mean sampling not be appropriate for smoothing the image given in question 3?

5. Use mean smoothing to remove noise from the following image of a black cat in a coal cellar:

/Worked Solutions/