Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

A-level Physics (Advancing Physics)/Digital Processing

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

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: 000000000000000150150150050150000000000000000150150150150150000000235000000150150150150150000000000000000150205150150150000000000000000150150150150150000000000000000150150150150150255000000000000150150150150150000000000000000150150150150150000000000000000150150150150095000000000000000150150150150150000000000185000150150150150150 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: 0000000000000501001501331331330000260260260501001501391391390000260260260501061731731501500000260260260501061731731501500000000000000501061731731501500430280000000501001501501501500430280000000501001501501501500430280000000501001501501441410000000000000501001501501441410000000210210711001501501441410000003131081100150150150150 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: 000000000000000150150150150150000000000000000150150150150150000000000000000150150150150150000000000000000150150150150150000000000000000150150150150150000000000000000150150150150150000000000000000150150150150150000000000000000150150150150150000000000000000150150150150150000000000000000150150150150150000000000000000150150150150150 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: 000000000000000150000000000000000000000000000150000000000000000000000000000150000000000000000000000000000150000000000000000000000000000150000000000000000000000000000150000000000000000000000000000150000000000000000000000000000150000000000000000000000000000150000000000000000000000000000150000000000000 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): 000255000000000000000255255000000000000000255000 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: 255255255255255255000255255255255255 /Worked Solutions/