COMPUTER HISTOLOGY & IMAGE ANALYSIS

Stuart Bunt & Guy Ben Ary

(Note: full text with illustrations can be seen at: http://iaaf.anhb.uwa.edu.au/iaaf/imageacquisition.html#Image Analysis Techniques)

THE DIGITAL IMAGE

Increasingly digital techniques are replacing conventional photography. This is happening in many fields from journalism to histology. The advantages are similar to the replacement of conventional typewriters with word processing. Speed of alteration, ability to cut and paste, ease of transmission of data from computer to computer, place to place, cheaper production and storage. There are similar drawbacks, ease of producing rubbish, problems with confirming veracity, plagiarism and copyright issues.

When a digital image is formed, the image can be taken in from any source, video, a conventional photograph, 35mm slide, an electron microscope, or directly from a digital camera (see http://iaaf.anhb.uwa.edu.au/iaaf/hardware.htini for some examples of hardware available) The digitization process divides an image into a horizontal grid of very small regions called "picture elements," or "pixels." In the computer this digital grid or "bitmap" represents the image. Each pixel is identified by its position in the grid, as referenced by its row (x) and column (y) number. In most systems, pixels are referenced from the upper left position of the bitmap, which is considered position 0,0 (row 0, column 0). Each pixels has a different colour or greyscale value and together they form a representation of the image.

Elements of the digital image

Pixel values and pixels depths

Digital images are made up of pixels. The colour, intensity, and lightness of pixels values determine the quality of the image. Depending on whether pixels are black and white, greyscale or colour, pixels have different bit depths. Bit depth refers to the amount (or "bits") of information allocated to each pixel.

When pixels are either black or white, pixels need only two bits of information (black or white), and hence the pixel depth is 2. Line art is typical black and white.

Greyscale: the number of greyscales used can vary but most systems have 256 shades of gray, 0 being black and 255 being white. When there are 256 shades of grey, each pixels has a bit depth of 8 bits (one byte), so that a 1000 x 1000 greyscale images occupies up to 1MB of memory. A black and white photograph is a greyscale image.

Colour. In digital colour images the RGB (red green blue, for objects which produce coloured light e.g. a computer monitor) or CMYK (Cyan, magenta, yellow and-black often used for printing colour where the four inks actually block the transmission of light from the underlying white paper) schemes are used. Each colour occupies 8 bits (one byte), ranging in value from 1-256. Hence in RGB each pixel occupies 8x3 =24 (3 bytes) bits, in CMYK 8x4 = 32 bits (4 bytes).

Pixel Resolution

A good definition of resolution is: the smallest distance at which two objects can be identified. In image analysis, resolution refers to the number of pixels used to represent the image. An image represented by 4000 x 3200 pixels has a higher resolution than the same image represented by 1000 x 800 pixels, because in the former, the higher number of pixels can represent more detail and hence the resolving power is greater. While in the computer these "pixels" have no relation to real size on the paper as you can use the computer and a printer to print the image at any size you want.

Image resolution is related to area: the more pixels devoted to each cm. of the image, the more detail you will be able to resolve. The relationship between number of pixels and area is commonly expressed by number of pixels per inch or ppi. More pixels per inch gives a better resolution. However file size is related to number of pixels so the final size of your file may be huge if you scan a large picture at high resolution.

You must bear in mind also the resolution of your printer. There is no point in scanning at high resolution if your printer can only print 75 dots per inch (some colour printers need three or more dots per pixel to give full colour). Similarly if you are scanning a huge poster but are going to print it postcard size you may only need to scan the original at low resolution to arrive at the printers 75 dpi output (e.g. l0in picture scanned at 50dpi would have 500 pixels along an edge, if you print it at half size the 5 in side will still be represented by 500 pixels, a resolution of 100dpi, more than a 75dpi printer can show).

Pixel Frequency Histogram

The frequency histogram refers to the frequency representation of different shades of grey or colour in the image. A frequency histogram displays the number of pixels representing each greyscale or colour value. Frequency histograms most commonly represent greyscale images and have many uses: the histogram may reveal an under-or overexposed image (too many pixels with values close to 0, or too many with values close to 255 respectively), and the histogram can be manipulated to change the image: frequency values can deleted, and upper and lower thresholds can be set.

Pixel Intensity, hue, saturation, brightness and contrast

Intensity refers to the amount of light reflected or transmitted from a scene. In a greyscale image, intensity represents the shades of grey, from zero brightness (black) to full brightness (white).

Hue controls the colour spectrum from red through to yellows, greens, blues and violets.

Saturation controls the purity of the colour, or how washed out the colour is with white light. For example, a hue of red can have numerous saturation levels from deep red to pink and finally white.

Brightness controls how bright the colour appears. It is similar to intensity, but whereas intensity refers to the amount of reflected colour of the original (physical) scene, brightness refers to the intensity value after the image has been acquired. (Note that sometimes brightness is referred to as lightness, in which case the HSB scale (hue, saturation brightness becomes the HSL scale (hue, saturation, lightness).

Contrast refers to the degree of difference in frequency values of pixels in the image. An image with low contrast appears as a tightly grouped mound of pixels occupying a small dynamic range of the greyscale spectrum. An image with high contrast occupies a large spectrum of the greyscale. In particular, pixels that are close together should have significant differences in frequency values.

These pages are based on the web pages at http://iaafanhb.uwa.edu.au/iaaf/imageacquisition.html#lmage

Analysis Techniques written and designed by Hugo Bouckaert

This includes:

Contrast enhancement

Example: changing contrast values, e.g. in Photoshop change brightness and contrast values under Image>Adjust>brightness/contrast).

Spatial filtering

Filtering techniques are divided into two categories: convolution filters (linear filters) and non-convolution (nonlinear) filters. Both techniques accomplish their results by examining and processing an image in small regions, called pixel "neighborhoods." A neighborhood is a square region of image pixels, typically 30, 5x5 or 7x7 in size.

Convolution filters

Example: Hi-Pass. The Hi-Pass filter accentuates intensity changes in an image by modifying a pixel's value to exaggerate its intensity difference from its neighbours. It produces an image with harsh intensity transitions, and generally results in an image with only edges of high contrast visible. Fine detail with low contrast is usually lost to the background. This filter can be used when you need to pull out just the elements having high contrast to the image background.

Non-convolution filters

Example: Erode and Dilate. The Erosion filter is a morphological filter that changes the shape of objects in an image by eroding (reducing) the boundaries of bright objects, and enlarging the boundaries of dark ones. It is often used to reduce, or eliminate, small bright objects. The Dilation filter is a morphological filter that changes the shape of objects in an image by dilating (enlarging) the boundaries of bright objects, and reducing the boundaries of dark ones. The dilation filter can be used to increase the size of small bright objects

These techniques can be performed in Image-Pro or in NIH-Image. In Image Pro, spatial filtering functions are found in the Tools>Filters command. In NIH-Image, load the "filters" macro from the NIH-Image\Macro subdirectory by selecting Special>Load Macros

Image combining

Image combining can be done in several ways: it is possible to extract one colour channel (e.g. red) and then combine this with another image. Often the problem arises that the background of the image that is phased in another one, totally obscures the features of the recipient image. If the background is flat (i.e. has constant grey values), the function quad (quadtree) solves this problem. The quadtree function splits the image up in regions, and examines whether any region is uniform. If it is, it is not extracted, if it is not uniform, the non-uniform part is extracted. This extraction procedure omits the background so that there is no problem with the background of the extracted image obscuring what is in the recipient image.

Frequency domain filtering

Frequency domain filtering involves frequency domain transforms. These transforms change an image from its spatial-domain form of brightnesses to a frequency domain of fundamental frequency components. One of the most commonly used is the Fast Fourier Transform. When an image is transformed with Fast Fourier, and the Fourier frequency is displayed, it appears symmetrical about the centre. The centre is the zero frequency point. Two axes run through the centre: the horizontal axis defines the horizontal (x value) frequency, the vertical axis the vertical (y value) frequency. The frequency magnitude is determined by the brightness of the pixel at a particular point. Fast Fourier Transforms are very good for filtering periodic noise in an image: one can eliminate bright spots in the edge enhancement.

Image edge enhancement reduces an image to show only its edge details. It is similar to Hi-Pass, although it focusses more on the edge itself rather than on the contrast between object and its surroundings. The most common is Laplacian edge enhancement. It highlights the edges in an image, irrespective of their orientation.

Noise reduction

Opening and Closing: The opening filter performs an erosion, then a dilation (see above). In images containing bright objects on a dark background, the opening filter smoothes object contours, breaks (opens) narrow connections, eliminates minor protrusions and removes small dark spots. In images with dark objects on a bright background, the opening filter fills narrow gaps between objects. The closing filter is a morphological filter that performs a dilation followed by an erosion. In images containing dark objects on a bright background, the opening filter smoothes object contours, breaks narrow connections, eliminates minor protrusions and removes small bright spots. In images with bright objects on a dark background, the closing filter fills narrow gaps between objects.

Shape measures

The most common measurements are those that count objects and/or describe the shape of objects in an image. In Image Pro it can be found under Measure>Count/Size (except Length which is found under Measure>Measurements). Image analysis programs offer many different measurements. The most common are:

• Length: the length of a line drawn

• Area: the pixel area of the interior of the object.

• Perimeter: the pixel distance around the circumference of the object.

• Area to perimeter ratio: a measure of the object's roundness, or compactness, giving a value between 0 and 1

• Major axis: the x, y endpoints of the longest line that can be drawn through the object

• Minor axis: the x, y endpoints of the longest line that can be drawn through the object while maintaining perpendicularity with the major axis.

• Number of holes: a count of how many holes exist within the interior of an object.

It has to be noted that these measurements would normally be expressed in pixels. However, they can be converted to another unit, such as microns, millimetres, or miles. (In Image pro one can go to Image>Calibration>Spatial and set number of pixels to another unit, e.g. microns, or miles). In NIH-Image go to Analyse>Set Scale to set the number of pixels to another unit.

Object classification

One of the most common ways to classify an object is to express an object's boundary as a chain code and then to analyse the numbers produced in the chain code further. A chain code is a set of numbers describing direction changes between subsequent pixels making up the boundary of an object. Another way is to classify object on the basis of similarities, e.g. on similar size of area. In Image Pro, this function is called auto-classification and can be found under the Measure>Count/Size>Measure>Auto-Classification. There is a maximum of three classifiers that can be used at once, e.g. objects can be classified using similarity of perimeter, density (greyscale value) and area.

Image Synthesis

°R

Visualisation - 2D and 3D image construction.

Instead of extracting data from an Image, digital images can be used to display complex data in a visual form that makes them easier to understand. Advanced Visual Systems (AVS), a high-end image analysis and visualisation program is able to read in data sets and then convert these to objects in a 3D field. In order to do this, one has to instance the Read Column-File or Field File module.