| ||||||||||||||
| ||||||||||||||
|
||||||||||||||
A Basic Introduction to Image Processing
This article is intended as an introductory look at image processing (not machine vision). We will look at how colour is represented within an image, how images are stored, what resolution means, as well as the most rudimentary statisical analysis of an image: the histogram. Colour RepresentationA quick look at how colour is represented on a computer. The two most commonly used representations are 8-bit greyscale and 24-bit colour. 8-bit greyscale contains 256 shades of grey (28 = 256) with 0 normally denoting black and 255 denoting white, with other values representing intermediate shades of grey. 24-bit colour is simply stored as 3-bytes denoting the red, green and blue components of the colour:
It is worth mentioned that colour can be stored in a variety of other ways, each of which have their own advantages and disadvantages: HSI (Hue, Saturation, Intensity), CMY (Cyan, Magenta, Yellow), Normalized RG, CIE, YIQ and a lot more. Image RepresentationNow that we understand how colours are stored, what about whole images? Simply put, images are stored as collections of pixels ('pixel' is in fact short for 'picture element'), each of which is assigned a colour. As an example, the left wing of this Su-47 has been blown up so you can see how the individual colours interact to create the star:
How much information can you convey in an image this way? This depends on the resolution at which the image is sampled. Sampling occurs when you scan an image, or take a picture with a digital camera. As with everything digital, the information provided has to be converted into discrete information, so the scanner/digital camera samples as much information as it can and converts it into a digital signal. With digital cameras, this is represented by the size of the CCD sensor (normally measured in megapixels). The greater the number of pixels the CCD contains, the larger the resolution, the more information is sampled. As an example, look at these three pictures:
The leftmost image is a picture of a friend of mine, sampled at 60x145. The middle image is simply a blow-up of her head, retaining the resolution. The rightmost image is her head sampled from a higher-resolution picture. Note the dramatic increase in information from the increased sampling. Of course, in image processing and machine vision, while increased resolutions allows for greater detail and more information to work with, it comes at the price of memory and computing speed. For example, the small left-hand image above occupies 26 kilobytes of memory (uncompressed), whereas the original image occupies over 9 megabytes (uncompressed). HistogramsA histogram is one of the simplest methods of analyzing an image. An image histogram maintains a count of the frequency for a given colour level. When graphed, a histogram can provide a good representation of the colour spread of the image. Histograms can also be used to equalize the image, as well as providing a large number of statistics about it. Here is an example of a histogram for the greyscale version of the Su-47 shown above:
Note how the majority of the colours seem to lie between about 80 and 120, which The corresponds to the dark grey background of the image. Extending histograms to RGB images is just as simple; with a separate plot for each colour, or a composite plot like the one shown below:
ReferencesEfford, Nick. Digital Image Processing: A Practical Introduction Using Java. Addison-Wesley. Essex: 2000.
Last Updated: 28/11/2004 Article content copyright © James Matthews, 2004.
|
|
|||||||||||||
All content copyright © 1998-2007, Generation5 unless otherwise noted.
- Privacy Policy - Legal - Terms of Use -