• Aucun résultat trouvé

Edge Enhancement

Dans le document Advances in Pattern Recognition (Page 154-157)

4.4 Content Processing

4.4.2 Edge Enhancement

Much of the perceptual capability of humans (and other animals as well) is heavily based on the recognition of edges that usually denote the limit between two objects in the scene or between objects and the background [8]. Since contours and ver-tices in images are typically perceived by the eye as sudden changes in luminance, due to the shadow projected by the objects when hit by a directional light, in the following only the graylevel component of the image will be taken into account.

For the very same reason, many of the techniques for edge detection based on varia-tions in luminance exploit linear correlation with derivative filters. Such filters are to be considered as local operators because they provide the output valueI(x, y)for

Fig. 4.1 Noise due to collapsing coordinates in forward rotation of the top-left image (from left to right: top row 0°, 90°; bottom row 5°, 15°, 45° clockwise rotation)

each pixel in the transformed image as a function of the values of a suitable neigh-borhood of the corresponding pixelI (x, y)in the original image. This ensures that the outcome is less affected by noise in the image around the pixel under processing.

Derivative Filters It has been just pointed out that object edges are characterized, from a perceptual viewpoint, by more or less sudden changes in luminance. If im-ages are seen as mathematical functions, the suitable tool in charge of determining the amount of change is represented by derivative functions. Indeed, being able to locate the image regions where variations in luminance take place most prominently allows emphasizing them while smoothing the remaining regions, obtaining in this way a new version of the image where the edges are more evident. Such an enhanced image can then be exploited as a more comfortable basis than the original one for applying further techniques aimed at the final edge detection. More precisely, due to images being two-dimensional functions, gradients come into play, i.e., the ex-tension ton-dimensional spaces of the concept of the derivative. Application of the gradient to a continuous function yields at each point a vector characterized by:

Direction and Sense the direction along which the maximum possible function variation for that point is obtained;

Magnitude the maximum value associated to the function variation.

A measure/estimation of the amount of change in a two-dimensional space (such as an image) can be obtained by computing the modulus of the gradient at every point, and can be represented by producing a map (another image) in which the re-gions having large gradient values are emphasized. In particular, the partial deriva-tives of the image with respect to the horizontal and vertical directions must be

computed, by means of the corresponding gradient components:

I =∂I

∂xi+∂I

∂yj ,

whereiandj are the unit vectors in directionsx andy, respectively. It is a deriva-tive filter because the gradient is a first derivaderiva-tive of the image. If the gradient is computed on the luminance feature of an image, the outcome corresponds to the ob-ject edges. An approximation of the strength of the retrieved edge can be computed as the sum of the magnitude of the horizontal and vertical gradient components:

|G| = |Gx| + |Gy|,

whereGxis the filter for directionx, andGyis the filter for directiony.

A first, simple computation of the gradient in a pointI (x, y)takes into account only the strictly horizontal and vertical directions:

Gx=I (x+1, y)−I (x−1, y)

2 ,

Gy=I (x, y+1)−I (x, y−1)

2 .

However, also the diagonal directions usually yield a significant contribution to the variation, in which case a correlation exploiting a filter based on a 3×3 mask that covers the whole neighborhood of a pixel is more indicated. These ideas underlie the technique proposed by Prewitt, that equally weights all directions:

Gx=

A similar filter that takes into account both the horizontal/vertical directions and the diagonal ones, but stresses the former components more than the latter, was proposed by Sobel [2], and is currently the most widely known and exploited:

Gx=

The operations to be carried out are:

1. Correlation of the original image with the filter for direction x that yields the valuesIx(x, y);

2. Correlation of the original image with the filter for directiony that yields the valuesIy(x, y);

3. Creation of an imageI(x, y), each of whose pixels represents the absolute mag-nitude of the gradient in that point, obtained as a modulus (Euclidean distance)

of the values of componentsIx(x, y)andIy(x, y)produced by the directional filters in the corresponding position of the image:

I(x, y)=

Ix(x, y)2+Iy(x, y)2.

Another famous filter is the Laplacian, based on second derivatives and defined as [10]: that can be represented by the following mask:

L=

further variants of which are [1]:

L8=

Adjacency between pixels of an imageI can be defined according to two different neighborhood strategies, one stricter and one looser, as follows:

4-neighborhood referred to the horizontal or vertical directions only;

8-neighborhood including the diagonal directions as well.

Thus, a pixel can have at most 4 possible neighbors in the former case, and at most 8 possible neighbors in the latter, as graphically depicted in Fig.4.2. In the following, Nk(p)will denote the set ofk-neighbors (k∈ {4,8}) of a pixelp.

Fig. 4.2 Neighborhood definitions for a reference pixel (denoted by·). +’s denote the positions adjacent to·that are taken into account by each connection strategy

Dans le document Advances in Pattern Recognition (Page 154-157)