** Next:** Line Extraction

** Up:** Methods

** Previous:** Calibration

Edge detection

The next step is to transform the images into a representation in which only edge segments remain. Edges are declared as significant changes in the signal level, thus can be searched with the help of convolution masks which approximate the first or second derivation of the image. If the mask measures the first derivation of the image in and direction, denoted as and , an edge point is found if the magnitude

of the convolution at the measured point is above a threshold . Also the direction

of the edge can be computed. A zero-crossing represents an edge in a mask which calculates the second derivation. The direction of the edge is stored in the values on the right and left side of the zero-crossing. Some popular convolution masks are:

**Sobel**- The Sobel operator approximates the first derivation of the image. The operator mask of the Sobel operator is defined as
**Prewitt**- The Prewitt is similar to the Sobel operator, its operation mask is defined as
(3.7) **Zero Crossing**- The core of the zero crossing operator is the LoG Filter (Laplacian of Gaussian). It is defined as
(3.8) **Canny**- The Canny edge detector can be roughly divided into six steps:
**Step 1**- During the first stage of the Canny algorithm, noise has to be filtered out. This is done by convolving the image with a Gaussian filter mask. The size of the mask is proportional to the sensitivity and indirectly proportional to the localization

achieved by the detector. **Step 2**- The strength of the edges is found by convolving the images with the Sobel operator (defined in Equation 3.6.), which performs a 2-D spatial gradient measurement on the image. The magnitude of the gradient can be found using the equation
A faster computation of the magnitude is given by

where and are the first derivations of the image in x and y direction. is proportional to variations in the horizontal direction and to variations in the vertical direction. If both derivates are combined, as it is in Equation 3.10 all directions are taken into consideration.

**Step3**- The direction of the edge can be computed as
**Step 4**- The direction has to be classified into five sectors. This process is similar to dividing a semicircle into five regions. Lets say the result of Equation 3.11 is and the new direction will be , then can be computed as:
(3.12) According to [HB93], it could be better to calculate the discrete tangent directly, without the indirection of first computing the and then classifying into five regions.

**Step 5**- After the edge directions are known, nonmaximum suppression is applied which traces along the edges and deletes every edge point (set it to 0) which is not considered to be an edge.
**Step 6**- Finally, hysteresis is used to eliminate the breaking up of an edge due to variations of the operator. Therefore two thresholds are defined. which is the higher threshold and which is the lower threshold. If the magnitude of a point is higher or equal to , it is immediately marked as an edge. Every pixel that is connected to such a pixel and has magnitude higher than is also marked as an edge. If you think of following an edge, the search starts at a pixel with a magnitude higher than and does not stop until a pixel with a magnitude lower than is reached.

The output of the Canny edge operator is an edge image with a low error rate, good localization and only one response to a single edge. Figure 3.7 shows the results of the Canny edge detector with two different thresholds. With a low threshold many artifacts remain whereas with a high threshold important information could be lost. The choice which thresholds to use depends on the demands of the continuative process as well as the environment conditions (natural light, artificial light, contrast, ).

**Figure 3.7:**

Result of the Canny edge detector, images are taken from a stereo camera system. The images are not rectified. The first column shows the original images, the pictures in the middle are produced by the Canny operator with = 3.2 and = 8.0, the thresholds of the operator producing the pictures on the right side are = 25.6 and = 51.2

**Next:**Line Extraction

**Up:**Methods