16
21 3. Edge Based Segmentation Image processing is any form of information processing for which the input is an image, such as frames of video; the output is not necessarily an image, but can be a set of features giving information about the image [152]. Since images contain lots of redundant data, scholars have discovered that the most important information lies in its edges [153]. They correspond to object boundaries, changes in surface orientation and texture. Edges typically correspond to points in the image where the gray value changes significantly from one pixel to the next. Thus, detecting Edges help in extracting useful information characteristics of the image where there are abrupt changes [154]. Edge detection is a process of locating an edge of an image. Detection of edges in an image is a very important step towards understanding image features. Edges consist of meaningful features and contained significant information. It reduces significantly the amount of the image size and filters out information that may be regarded as less relevant, preserving the important structural properties of an image [152]. Since edges often occur at image locations representing object boundaries, edge detection is extensively used in image segmentation when images are divided into areas corresponding to different objects. This can be used specifically for enhancing the tumor area in mammographic images or it will help to separate out Cerebrospinal fluid (CSF), White matter in MRI Images and even to indicate some present abnormalities. There are many methods of detecting edges; the majority of different methods may be grouped into these two categories:

3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

21

3. Edge Based Segmentation

Image processing is any form of information processing for which

the input is an image, such as frames of video; the output is not

necessarily an image, but can be a set of features giving

information about the image [152]. Since images contain lots of

redundant data, scholars have discovered that the most important

information lies in its edges [153]. They correspond to object

boundaries, changes in surface orientation and texture. Edges

typically correspond to points in the image where the gray value

changes significantly from one pixel to the next. Thus, detecting

Edges help in extracting useful information characteristics of the

image where there are abrupt changes [154].

Edge detection is a process of locating an edge of an image.

Detection of edges in an image is a very important step towards

understanding image features. Edges consist of meaningful features

and contained significant information. It reduces significantly the

amount of the image size and filters out information that may be

regarded as less relevant, preserving the important structural

properties of an image [152]. Since edges often occur at image

locations representing object boundaries, edge detection is

extensively used in image segmentation when images are divided

into areas corresponding to different objects. This can be used

specifically for enhancing the tumor area in mammographic images

or it will help to separate out Cerebrospinal fluid (CSF), White

matter in MRI Images and even to indicate some present

abnormalities.

There are many methods of detecting edges; the majority of

different methods may be grouped into these two categories:

Page 2: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

22

Gradient: The gradient method detects the edges by looking

for the maximum and minimum in the first derivative of the

image. For example Roberts, Prewitt, Sobel operators detect

vertical and horizontal edges. Sharp edges can be separated

out by appropriate thresholding.

Laplacian: The Laplacian method searches for zero crossings

in the second derivative of the image to find edges e.g. Marr-

Hildreth [79], Laplacian of Gaussian etc.

In this chapter gradient method is discussed for image

segmentation of mammographic and MRI images.

3.1. Edge Operators

Edge detection is one of the most frequently used techniques in

digital image processing [155]. The boundaries of object surfaces in

a scene often lead to oriented localized changes in intensity of an

image, called edges. This observation combined with a commonly

held belief that edge detection is the first step in image

segmentation, has fueled a long search for a good edge detection

algorithm to use in image processing [156]. This search has

constituted a principal area of research in low level vision and has

led to a steady stream of edge detection algorithms published in the

image processing journals over the last two decades. Three most

frequently used edge detection methods such as Sobel, Prewitt and

Kirsch edge operators are used for comparison. These methods are

explained in detail in the following section.

Steps for edge detection method

Input: A Sample Image (Mammography/MRI)

Output: Slope magnitude Image

Step 1: Read input image

Page 3: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

23

Step 2: Apply horizontal mask Gx and vertical mask Gy to the

input image

Step 3: Apply different edge detection algorithms and find the

gradient

Step 4: Construct separate image for Gx and Gy

Step 5: Results are combined to find the absolute magnitude of

the gradient.

|G| = √Gx2 + Gy

2

Step 6: The absolute magnitude is the output slope magnitude

image

Step 7: For some slope magnitude images, the pixels values are

too small or too high. To improve visibility of those

images, scaling has to be done .For small values, it has

to be scaled up by appropriate factor. For large values,

it has to be scaled down by appropriate factor.

3.1.1. Sobel edge operator

The Sobel operator performs a 2-D spatial gradient measurement

on an image and so emphasizes regions of high spatial frequency

that correspond to edges. Typically it is used to find the

approximate absolute gradient magnitude at each point in an input

grayscale image. In theory at least, the operator consists of a pair

of 3x3 convolution kernels as shown in Figure 3.1. One kernel is

simply the other rotated by 900. The convolution masks of the Sobel

edge detector are shown in Figure 3.1.

Figure 3.1 Sobel convolution kernels

Page 4: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

24

This implies that the result of the Sobel operator at an image point

which is in a region of constant image intensity is a zero vector and

at a point on an edge is a vector which points across the edge, from

darker to brighter values. Using steps mentioned in section 3.1.

Sobel operator was used on mammographic images. Results are

shown in Figure 3.2 and 3.3.

Results for mammographic images

Mammographic image 1

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude (e) Scaled Image

Figure 3.2 Results using Sobel operator for mammographic image 1

Mammographic image 2

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude (e) Scaled Image

Figure 3.3 Results using Sobel operator for mammographic image 2

Observations: Figures 3.2(a) and 3.3(a) are original mammographic images. In

both the cases Figures 3.2(b) and 3.3(b) show horizontal edges where as Figures

3.2(c) and 3.3(c) indicate vertical edges for original image using Sobel operator.

Figures 3.2(d) and 3.3(d) are slope magnitude image which are derived from (b)

and (c). But the pixel values for these images are too small hence for visibility

purpose scaling is applied which is displayed in Figures 3.2(e) and Figure 3.3 (e)

where tumor boundary is clearly visible.

In similar manner results were obtained for MRI images using Sobel

operator shown in Figure 3.4 and 3.5.

Page 5: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

25

Results for MRI Images

MRI1

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude

Figure 3.4 Results using Sobel operator for MRI 1

MRI2

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude

Figure 3.5 Results using Sobel operator for MRI 2

Observations: Figures 3.4(a) and 3.5(a) are original MRI images. In both the

cases Figure 3.4(b) and 3.5(b) shows horizontal edges where as Figures 3.4(c)

and 3.5(c) indicate vertical edges for original image using Sobel operator. Figures

3.4(d) and 3.5(d) are slope magnitude image which are derived from (b) and

(c).Here the inner details of tumor are clearly visible along with its boundaries.

3.1.2. Prewitt operator

Prewitt operator is method of edge detection in image processing

which calculates the maximum response of a set of convolution

kernels to find the local edge orientation for each pixel. The Prewitt

edge detector is an appropriate way to estimate the magnitude and

orientation of an edge. Although differential gradient edge detection

needs a rather time-consuming calculation to estimate the

orientation from the magnitudes in the x- and y-directions. For

Prewitt operator, one kernel being sensitive to edges in the vertical

direction and one to the horizontal direction as shown in Figure 3.6.

Page 6: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

26

Figure 3.6 Prewitt convolution kernels (3x3)

Results for mammographic images

Mammographic image 1

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude (e) Scaled Image

Figure 3.7 Results using Prewitt operator for mammographic image 1

Mammographic image 2

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude (e) Scaled Image

Figure 3.8 Results using Prewitt operator for mammographic image 2

Observations: Figures 3.7(a) and 3.8(a) are original mammographic images. In

both the cases Figures 3.7(b) and 3.8(b) show horizontal edges where as Figures

3.7(c) and 3.8(c) indicate vertical edges for original image using Prewitt

operator. Figures 3.7(d) and 3.8(d) are actual slope magnitude image which are

derived from (b) and (c). But the pixel values for these images are too small

hence for visibility purpose scaling is applied which is displayed in Figure 3.7(e)

and Figure 3.8(e).It may be observed that the boundaries of tumor are less sharp

as compare to Sobel operator.

Page 7: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

27

Results for MRI Images

MRI 1

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude

Figure 3.9.Results using Prewitt operator for MRI 1

MRI 2

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude

Figure 3.10.Results using Prewitt operator for MRI 2

Observations: Figures 3.9(a) and 3.10(a) are original MRI images. In both the

cases Figures 3.9(b) and 3.10(b) show horizontal edges where as Figures 3.9(c)

and 3.10(c) indicate vertical edges for original image using Prewitt operator.

Figures 3.9(d) and 3.10(d) are actual slope magnitude image which are derived

from (b) and (c). The boundaries of the tumor appear to be less sharp as

compared to Sobel operator.

3.1.3. Kirsch edge operator

The kirsch edge detector detects edges using eight filters are

applied to the image with the maximum being retained for the final

image. The eight filters are a rotation of a basic compass

convolution filter. For comparison with Sobel and Prewitt operator

here only two directions horizontal and vertical convolution kernels

(3x3) are considered as shown in Figure 3.11. The same steps as

used for Sobel and Prewitt operators are used and results are given

below.

Page 8: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

28

Figure 3.11 Kirsch convolution kernels (3x3)

Results for mammographic images

Mammographic image 1

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude

Figure 3.12 Results using Kirsch operator for mammographic image 1

Mammographic image 2

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude

3.13 Results using Kirsch operator for mammographic image 2

Observations: Figures 3.12(a) and 3.13(a) are original mammographic images. In

both the cases Figures 3.12(b) and 3.13(b) show horizontal edges where as

Figures 3.12(c) and 3.13(c) indicate vertical edges for original image using

Kirsch operator. Figures 3.12(d) and 3.13(d) are slope magnitude image which

are derived from (b) and (c).It is seen that no scaling is required and the

boundaries are clear.

Page 9: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

29

Results for MRI Images

MRI 1

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude (e) Scaled Image

3.14 Results using Kirsch operator for MRI 1

MRI 2

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude (e) Scaled Image

3.15 Results using Kirsch operator for MRI 2

Observations: Figures 3.14(a) and 3.15(a) are original MRI images. In both the

cases Figures 3.14(b) and 3.15(b) show horizontal edges where as Figures

3.14(c) and 3.15(c) indicate vertical edges for original image using Kirsch

operator. Figures 3.14(d) and 3.15(d) are actual slope magnitude image which

are derived from (b) and (c). Here in this case the brightness is high needs

scaling down as shown in Figures 3.14(e) and 3.15(e).

For Mammographic images, segmentation provided by Kirsch

operator is better than Sobel and Prewitt operators. In a segmented

image given by kirsch operator, all edges are quite clear and it also

indicates variation in texture which will help in further diagnosis.

For MRI images, segmentation provided by Sobel operator is better

than Kirsch and Prewitt operators. Segmented image given by Sobel

operator provides proper edges for the texture variation. It also

gives boundary of ring which clearly indicates abnormality in the

brain.

Page 10: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

30

3.2. Extended Edge Operator

Even though kirsch and Sobel give satisfactory segmentation of

mammographic and MRI images respectively, it is necessary to

improve these segmentation results further because Kernel of size

3x3 is small which provides highly localized variation in an image.

To improve it further and to take more neighborhood of the pixel

into consideration, extended edge operators of kernel size 5x5 has

been proposed in the following section. It shows the effect of these

extended kernels for Sobel, Prewitt and Kirsch operators for

mammographic and MRI images.

3.2.1. Extended Sobel operator

To achieve better segmentation 3x3 kernels are modified to 5x5

kernels which show linear regions more clearly than in the previous

case. These 5 X 5 kernels are as shown in Figure 3.16. One kernel

is simply the other rotated by 90º.

Figure 3.16 Extended Sobel convolution kernels(5x5)

All the steps as explained in section 3.1 are repeated for newly proposed edge operators.

Page 11: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

31

Results using extended Sobel operator

Mammographic Image 1

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude

Figure 3.17 Results using Extended Sobel operator for mammographic image 1

Mammographic Image 2

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude

Figure 3.18 Results using Extended Sobel operator for mammographic image 2

Observations: Figures 3.17(a) and 3.18(a) are original mammographic images. In

both the cases Figure 3.17(b) and 3.18(b) show horizontal edges where as

Figures 3.17(c) and 3.18(c) indicate vertical edges for original image using

Extended Sobel operator. Figures 3.17(d) and 3.18(d) are slope magnitude image

which are derived from (b) and (c). As compared to earlier results this extended

Sobel operator gives clear and sharp edges of the tumor.

Results for MRI Images

MRI 1

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude (e) Scaled Image

Figure 3.19 Results using Extended Sobel operator for MRI 1

Page 12: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

32

MRI 2

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude (e) Scaled Image

Figure 3.20 Results using Extended Sobel operator for MRI 2

Observations: Figures 3.19(a) and 3.20(a) are original MRI images. In both the

cases Figures 3.19(b) and 3.20(b) show horizontal edges where as Figures

3.19(c) and 3.20(c) indicate vertical edges for original image using Extended

Sobel operator. Figures 3.19(d) and 3.20(d) are slope magnitude image which

are derived from (b) and (c). But the pixel values for these images are too high

hence for visibility purpose appropriate scaling is applied which is displayed in

Figures 3.19(e) and figure 3.20(e). Results are better compared to 3x3 Sobel

operator.

3.2.2. Extended Prewitt operator

These 5 X 5 kernels are as shown in Figure 3.21. One kernel is

simply the other rotated by 90º.

Figure 3.21 Extended Prewitt convolution kernels(5x5)

Results for Mammographic Images

Mammographic Image 1

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude Figure 3.22 Results using Extended Prewitt operator for mammographic image 1

Page 13: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

33

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude Figure 3.23 Results using Extended Prewitt operator for mammographic image 2

Observations: Figures 3.22(a) and 3.23(a) are original mammographic images. In

both the cases Figures 3.22(b) and 3.23(b) show horizontal edges where as

Figures 3.22(c) and 3.23(c) indicate vertical edges for original image using

Extended Prewitt operator. Figures 3.22(d) and 3.23(d) are slope magnitude

image which are derived from (b) and (c). The results indicate very sharp and

clear boundaries for tumor.

Results for MRI Images

MRI 1

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude (e) Scaled Image

Figure 3.24 Results using Extended Prewitt operator for MRI 1

MRI 2

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude (e) Scaled Image

Figure 3.25 Results using Extended Prewitt operator for MRI 2

Observations: Figures 3.24(a) and 3.25(a) are original MRI images. In both the

cases Figures 3.24(b) and 3.25(b) shows horizontal edges where as Figures

3.24(c) and 3.25(c) indicates vertical edges for original image using Extended

Prewitt operator. Figures 3.24(d) and 3.25(d) are slope magnitude image which

are derived from (b) and (c). But the pixel values for these images are too high

hence for visibility purpose appropriate scaling is applied which is displayed in

Page 14: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

34

Figures 3.24(e) and figure 3.25(e).The results are better as compared to Prewitt

3x3 kernel edge operator

3.2.3. Extended Kirsch edge operator

After observing these results for 3x3 kernels which are over

segmented for MRI images, so to reduce this over segmentation

3x3 convolution kernels are modified to 5x5 convolution kernels for

0º and 90º as shown in Figure 3.26.

Figure 3.26 Extended Kirsch convolution kernels (5x5)

Results for Mammographic Images

Mammographic Image 1

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude

Figure 3.27 Results using Extended Kirsch operator for mammographic image 1

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude

Figure 3.28 Results using Extended Kirsch operator for mammographic image 2

Page 15: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

35

Observations: Figures 3.27(a) and 3.28(a) are original mammographic images. In

both the cases Figures 3.27(b) and 3.28(b) show horizontal edges where as

Figures 3.27(c) and 3.28(c) indicate vertical edges for original image using

Extended Kirsch operator. Figures 3.27(d) and 3.28(d) are slope magnitude

image which are derived from (b) and (c). The results are clear and sharp as

compared to Kirsch operator shown earlier.

Results for MRI Images

MRI 1

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude (e) Scaled Image

Figure 3.29 Results using Extended Kirsch operator for MRI 1

MRI 2

(a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope Magnitude (e) Scaled Image

Figure 3.30 Results using Extended Kirsch operator for MRI 2

Observations: Figures 3.29(a) and 3.30(a) are original MRI images. In both the

cases Figures 3.29(b) and 3.30(b) show horizontal edges where as Figures

3.29(c) and 3.30(c) indicate vertical edges for original image using Extended

Kirsch operator. Figures 3.29(d) and 3.30(d) are slope magnitude images which

are derived from (b) and (c). But the pixel values for these images are too high

hence for visibility purpose appropriate scaling is applied which is displayed in

Figure 3.29(e) and Figure 3.30(e). The results are far better as compared to 3x3

Kirsch operator.

Page 16: 3. Edge Based Segmentation - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/9107/8/08_chapter3.pdf · MRI2 (a) Original Image (b) Horizontal Edges (c) Vertical Edges (d) Slope

36

3.3 Discussion

In this chapter 5x5 extended edge operators are proposed. By using

these proposed extended operators, it is observed that the results

using 5x5 kernel are far better for all three types of edge operators

than by using 3x3 kernels.

To be more specific it is observed that for mammographic images,

proposed extended 5x5 Sobel operator gives better segmentation

than Kirsch and Prewitt operator. It shows more details with proper

edges which are required to observe any abnormal image which

provide guidance for further treatment. So far as MRI images are

concerned 5x5 Extended Sobel operator gives better results.

However the performance of Extended Kirsch operator is equally

good.