0
4.2kviews
How is edge detected in an image?
1 Answer
0
76views

Variation of scene features, usually brightness, give rise to edges. In other words, edges are representations of the discontinuities of the scene intensity function.

To detect these discontinuities as edges. The process of edge detection is carried out by the derivative approach. Consider the image shown in figure.

enter image description here

Figure 19

Above figure shows that the first derivative of the grey line profile is positive at the leading edge of a transition, negative at the trailing edge and zero in areas of constant grey levels. We can thus conclude that computing the derivative helps us in detecting the edges.

The first derivative at any point in an image is obtained by using the magnitude of the gradient at that point.

Finding Gradients using Masks:

$|∇F|=|Z_{5} - Z_{8} |+|Z_{5} - Z_{6} |$

This is the first order difference gradient. This can be implemented using two masks.

enter image description here

This is known as Ordinary operator.

Steps to compute the gradient of an image are as follows:

1) Convolve the original image with mask 1. This gives us the gradient along the x-direction.

2) Convolve the original image with mask 2. This gives us the gradient along the y-direction.

3) Add the results of 1 and 2.

There is another direct method of implementing the ordinary operator practically. It gives results that are almost similar.

1) Add masks 1 and 2.

enter image description here

2) Convolve the original image with this resultant mask to get the gradient image.

Roberts Mask:

Ordinary masks $|∇F|=|Z_{5} - Z_{8} |+|Z_{5} - Z_{6} |$

Roberts masks $|∇F|=|Z_{5} - Z_{9} |+|Z_{6} - Z_{8} |$

enter image description here

The resultant of Roberts mask are shown along with the program.

The sum of the two Roberts masks is

enter image description here

Prewitts Operator:

While approximating the first derivative, assigns similar weights to all the neighbors of the candidate pixel whose edge strength is being calculated.

$ ∇F=|(Z_{7} + Z_{8} + Z_{9} ) - (Z_{1} + Z_{2} +Z_{3} ) | + x - gradient $

$ ∇F=|(Z_{3} + Z_{6} + Z_{9} ) - (Z_{1} + Z_{4} +Z_{7} ) | + y - gradient $

From this equation, the masks that we obtain are:

enter image description here

These masks are known as the Prewitts masks.

Sobel Operator:

The Sobel operator is a derivate mask and is used for edge detection. Sobel operator is also used to detect two kinds of edges in an image:

  • Vertical direction
  • Horizontal direction

In Sobel operator the coefficients of masks are not fixed and they can be adjusted according to our requirement unless they do not violate any property of derivative masks.

Following is the vertical Mask of Sobel Operator:

-1 0 1
-2 0 2
-1 0 1

When applied on an image this mask will highlight the vertical edges. When we apply this mask on the image it prominent vertical edges. It simply works like as first order derivate and calculates the difference of pixel intensities in the edge region.

As the center column is of zero so it does not include the original values of an image but rather it calculates the difference of right and left pixel values around that edge. Also the center values of both the first and third column is 2 and -2 respectively.

This give more weight age to the pixel values around the edge region. This increase the edge intensity and it will become enhanced comparatively to the original image.

Following is the horizontal Mask of Sobel Operator

-1 -2 -1
0 0 0
1 2 1

Above mask will find edges in horizontal direction and it is because that zeros column is in horizontal direction. When you will convolve this mask onto an image it would prominent horizontal edges in the image. The only difference between it is that it have 2 and -2 as a center element of first and third row.

This mask will prominent the horizontal edges in an image. It also works on the principle of above mask and calculates difference among the pixel intensities of a particular edge.

As the center row of mask is consist of zeros so it does not include the original values of edge in the image but rather it calculate the difference of above and below pixel intensities of the particular edge. Thus increasing the sudden change of intensities and making the edge more visible.

Please log in to add an answer.