Elements of Computer Vision

Pre-Processing and Edge Detection

• Line Detection
A image in a photograph is called a raw image, and in order to extract useful information from it, it must be put in a certain form. The first step in preparing the picture for higher-level processing is called pre-processing. The purpose of pre-processing is two-fold: to eliminate undesirable features that will hinder further processing and to extract the desirable features that represent useful information in the image. Unwanted image attributes include noise (insignificant lines and contours) and the presence of featureless space. The important features include surface details and boundaries such as lines, edges, and vertices.

• Edge Detection
The first step in object pre-processing is edge detection. To isolate an image from its background and neighboring images, you must first recognize its edges. An edge in an image is an image contour across which the image's brightness or hue changes abruptly, perhaps in the magnitude or in the rate of change in the magnitude (Nalwa, 75). These edges are modeled as mathematical discontinuities. The principle intensity edges in an object are:
1. surface-normal discontinuities (top vs. side)
2. depth discontinuities (side of an object)
3. surface-reflectance/reflective discontinuities (text/ink)
4. illumination discontinuities (shadows)

Two methods of edge detection are Thresholding using Histograms and Gaussian Convolution.

• Thresholding
Thresholding is a process by which the intensity resolution of a picture is reduced (to be displayed, for example, on a computer that does not support as high an intensity resolution as the picture). The threshold should be between the average intensity of the object and the average intensity of the background or other object. Histograms aid in the use of determining this value.

• Histograms
Histograms are used to separate an image from its background and to separate objects of different colors, by calculating and locating in the picture the changes in intensity resolution. A histogram is used one of two ways. One is a graph of the frequency of occurrence of each level of intensity in an image. It indicates the picture's changes in intensity by finding all the values of the pixels in the picture and then plotting the number of pixels that have each value. If the image is a high-intensity image, where the difference between the object and the background is very different, the graph will contain many well-defined peaks.

The threshold lies at one of these peaks (or troughs). The second method by which histograms are utilized is to record the value of every pixel as it appears in the picture. This method is employed more for edge detection: as the resolution of the graph increases, a more defined edge or threshold can be located by closer examination of the change in the pixels' intensities. Notice the abrupt intensity changes in this close-up:

One issue that may arise in edge detection with histograms is that of noise. In the histogram shown, there is more than one peak; some of the peaks could be mistaken for an edge. These subsidiary peaks occur because of the presence of noise in the image. Below is an example of a noisy image, and its results after edge detection:

Processes such as smoothing and convolution serve to diminish these distractions -- in particular Gaussian Convolution is widely used. Gaussian Convolution is a mathematical algorithm that employs the Gaussian function and its derivative to calculate and locate only those pixels in a picture that mark the edges of the image.

To try out edge-detection for yourself, check out the Edge Detector Demo at Carnegie Melon University.