• 沒有找到結果。

2.2 Spatial Image Enhancement Methods

2.2.3 Histogram Equalization

g(x, y) = f (x, y) " f (x + 1, y) + f (x, y + 1) + f (x "1, y) + f (x, y "1)

[ ]

+ 4 f (x, y)

= 5 f (x, y) " f (x + 1, y) + f (x, y + 1) + f (x "1, y) + f (x, y "1)

[ ]

(2- 14) This equation can be implemented using the mask show in Fig. 2- 6(a). The mask show in Fig.

2- 6(b) would be used if the diagonal neighbors also were included in the calculation of the Laplacian.

(a) (b)

Fig. 2- 6 (a) Composite Laplacian mask (b) A second composite mask.

2.2.3 Histogram Equalization

The probability of occurrence of gray level

! where, n is the total number of pixels in the image,

!

nk is the number of pixels that have gray level

!

rk, and L is the total number of possible gray levels in the image. The discrete version of the transformation function is

Thus, a processed (output) image is obtained by mapping each pixel with level

!

rk in the input image into a corresponding pixel with level

!

rk is called a histogram. The transformation (mapping) given in

Eq.(2-15) is called histogram equalization or histogram linearization. On the other hand, the inverse transformation from s back to r is denoted by

!

rk= T"1(sk) k = 0,1,2,K,L "1 (2- 17)

Only if none of the levels,

!

rk,k = 0,1,2,K,L "1, are missing from the input image. In addition to producing gray levels that have this tendency, the method just derived has the additional advantage that it is fully “automatic.” In other words, given an image, the process of histogram equalization consists simply of implementing Eq.(2-16), which is based on information that can be extracted directly from the given image, without the need for further parameter specifications.

Fig. 2- 7(a) shows the four basic image types: dark, light, low contrast, high contrast, and Fig. 2- 7(b) shows the result of performing histogram equalization on each of these images.

The first three results (top to bottom) show significant improvement. As expected, histogram equalization didn’t produce a significant visual difference in the fourth image because the histogram of this image already spans the full spectrum of the gray scale. The histograms of the equalized images are shown in Fig. 2- 7(c). All these histograms are different, the histogram equalized images themselves are visually very similar. This isn’t unexpected because the difference between the images in the left column is simply one of contrast, not of content. In other words, since the images have the same content, the increase in contrast resulting from histogram equalization was enough to render any gray-level differences in the resulting images visually indistinguishable. Given the significant contrast differences of the images in the left column, this example illustrates the power of histogram equalization as an adaptive enhancement tool.

20

(a) (b) (c)

Fig. 2- 7 (a) Original images. (b) Results of histogram equalization.

(c) Corresponding histograms

2.3 The Equation of Parabola

The equation of a Parabola is also called Cartesian equation too. The parabola’s equation in standard polynomial form is denoted by:

!

y = ax2+ bx + c (2- 18)

Fig. 2- 8 shows a plot of equation of parabola. In Eq.(2-18), x is called the independent variable (the horizontal axis on the graph) and y is called the dependent variable (the vertical

axis), and a, b and c called parameters. Although it is also possible to choose values for a, b and c arbitrarily, for any one particular parabola their values will not change. A new set of values for a, b and/or c will result in a different parabola. The graph of

!

y = ax2+ bx + ctakes the shape of the cross-section of a bowl, opening either upwards or downwards. The lowest point when it opens upwards (or the highest point when it opens downwards) is called the vertex. All parabolas with the above equation will cross the y-axis somewhere, but need not

necessarily cross the x-axis Here y is a function of (i.e. depends on) x, written y = f(x) in general, so here we can write

!

f (x) = ax2+ bx + c. In this case, f(x) is called the quadratic function. The quadratic function has important applications in the mathematical analysis of

topics in, amongst others, science, technology and business studies – in particular in cases where there is a square-law relationship between two sets of variables.

The equation of parabola still have the another types:

Standard Form Equation:

!

where, some basic definitions are given by:

Vertex:

!

(h,k) ,

Axis of symmetry: x = h, Focus: h = k + c,

22

Opens: up if c > 0 / down if c < 0 For exampleL

· the cross-sectional shape of a car's headlamp reflector is parabolic, and

· the aerodynamic drag of a moving vehicle is proportional to its velocity squared.

Fig. 2- 8 The plot of parabola equation

2.4 Mathematical Morphology

Mathematical morphology is closely related to integral geometry (show [11]) and it quantifies many aspects of the geometrical structure of images in a way that agree with human intuition and perception. Mathematical morphology has been also a valuable tool in many computer vision applications, especially in the area of automated visual inspection.

Morphological expressions are defined as the combinations of basic operations known as erosions and dilations. The morphological approach analyzes an image in terms of some predetermined geometric shape templates known as elemental structuring elements. The manner in which the structuring elements can be embedded into the original shape using a specific sequence of operations leads eventually to shape classification and/or discrimination.

In the following sections, we first introduce the fundamental morphological operations upon which the entire subsequent development depends. We then discuss the extensions of binary morphological operations to the gray-value morphological operations.

There are two types of fundamental operations in mathematical: dilations and erosions, each associated with a structuring element. These two types of operations are both based on the Minkowski operations will be discussed below.

2.4.1 Morphological Operations Some basic definitions:

E: the n-dimensional Euclidean space

!

P(E) : The power set of E.

!

Ab : The set of translation of A by b given by a + b | a " A

{ }

,

where A is a set in P(E) and b is a vector in E.

S": The reflected set of A with respect to the orgin given by #a | a $ A

{ }

,

where A is a set in P(E).

24

b!B

B={(4,1),(5,1),(5,2)}

A ! B Minkowski Addition

Let A and B be two sets in P(E). The Minkowski addition of A and B, denoted A⊕B, is defined as

A ⊕ B = { a + b | a ! A and b ! B }. (2- 20) In terms of translation, the Minkowski addition of A and B can also be written as

A ⊕ B = ∪Ab. (2- 21)

Thus A ⊕ B is constructed by translating A by each element of B and then taking the union of all the resulting translates

For example, let A be the unit disk centered at (2,2) and let B={(4,1), (5,1), (5,2)}. Then A ⊕ B is the union of the sets

!

A(3,1), A(5,1), and

!

A(5,2). A, B, and A ⊕ B are depicted in Fig. 2-

9

Fig. 2- 9 Minkowski addition

Minkowski Subtraction

Let A and B be two sets in P(E). The Minkowski subtraction of B from A, written as A0B, is defined by

A 0 B =

!

A " b = Ab

b #B$

b #B

I I

(2- 22)

In this operation, A is translated by the reflection of B and then the intersection is taken.

For example, consider the 4 by 3 rectangle A. Let B = {(0,0),(1,1)}. Then A0B is the intersection of the translates

!

A"(0,0) and

!

A"(1,1). That is, A0B is the the 3 by 2 rectangle depicted in Fig. 2- 10.

Fig. 2- 10 Minkowski subtraction

2.4.2 Structuring Element

A structuring element is also a set in P(E), however, it is usually chosen to have simple shape and small size. The structuring element can be viewed as a convolution mask.

Therefore, dilations and erosions are analogous to the convolution processes.

Dilation

B = {(0,0),(0,1)}

A! " B A

26

The set Ds( A) is called the dilated set of A by the structuring element S.

Geometrical meaning: Ds(A)={x$E|Sx #A"!}.

Erosion

The erosion Es( A) with a structuring element S is a unary operation on P(E) defined by A

A

Es( )= 0S. (2- 24) The set Es( A) is called the eroded set of A by the structuring element S.

Geometrical meaning: Es(A)={x"E|Sx ! A}.

For example, consider a set

!

A(Fig. 2- 11(a)) and a structuring element

!

S (Fig. 2- 11(b)). Dilating the set

!

A by the structuring element

!

S has the effect of “expanding” the set.

(see Fig. 2- 11(c)). Erosion has the effect of “shrinking” the set (see Fig. 2- 11(d)).

Fig. 2- 11 (a) Set A (b) Structuring element S and its reflection

!

S"

(c) Dilation of A by S (d) Erosion of A by S (a) (b)

(c) (d)

2.4.3. Extensions to Gray-scale Morphology

In this section we extend to gray-level images the basic operations, dilation and erosion.

Throughout the discussions that follow, we deal with digital image functions of the forms f x y( , )andb x y( , ), where f x y( , )is the gray-scale image andb x y( , )is a structuring element, itself an image function.

Dilation illustrated in Fig. 2- 12. Because the dilation is based on choosing the maximum value of

!

f + b in a neighborhood defined by the shape of the structuring element, the general effect

of performing dilation on a gray-scale image is two-fold: (1) if all the values of the structuring element are positive, the output image tends to be brighter than the input; and (2) dark details either are reduced or eliminated, depending on how their values and shapes relate to the structuring element used for dilation.

Erosion

The erosion

!

D( f ,b) of the gray-scale image

!

f by structuring element

!

Fig. 2- 12(e) shows the result of eroding the function of Fig. 2- 12(b) by the structuring element of Fig. 2- 12(a). As Eq.(2-26) indicates, erosion is based on choosing the

28

elements of the structuring element are positive, the output is tends to be darker than the input image; and (2) the effect of bright details in the input image that are smaller in “area” than the structuring element is reduced, with the degree of reduction being determined by the

gray-scale values surrounding the bright detail and by shape and amplitude values of the structuring element itself.

Fig. 2- 12 Dilation and erosion of 1-D function

For example, Fig. 2- 13(a) shows

!

172 "112 gray-scale image, and Fig. 2- 13(b) shows the result of dilating the image with a “flap” structuring element with size

!

5 " 5 pixels. Based on the preceding discussion, dilation is expected to produce an image that is brighter than the original image and in which small, dark detail have been reduced or eliminated. These effects clearly are visible in Fig. 2- 13(b). Not only does the image appear brighter than the original,

)

but the size of dark features has been reduced. Fig. 2- 13(c) shows the result of eroding the original image. Note the opposite effect to dilation. The eroded image is darker, and the sizes of small, bright features are reduced.

Fig. 2- 13 Dilation and erosion of image in Fig. 2- 13(a). (a) Original image;

(b) Result of dilation; (c) Result of erosion.

2.4.4 Morphological Contrast Enhancement

In addition to the operations discussed earlier in connection with the removal of small dark and bright artifacts, dilation and erosion often are used to compute the morphological contrast enhancement of an image, denoted g:

f b f

g =( " )!( 0b). (2- 27)

Fig. 2- 14shows the actions of morphological contrast enhancement. Fig. 2- 15 shows the result of computing the morphological contrast enhancement of the image shown in Fig. 2- 13(a). As expected, the morphological contrast enhancement highlights sharp gray-scale transitions in the input image. The morphological contrast enhancement is sensitive to the shape of the chosen structuring element. As such, the adaptive structuring element has been

30

important filter for our proposed method.

Fig. 2- 14 Morphological contrast enhancement filter

Fig. 2- 15 Morphological contrast enhancement of the image in Fig. 2- 13(a) (a)

f

(b) b

f ! b

(c)

f ! b

(d)

!

( f " b) # ( f 0b)

!

( f " b)

!

( f " b)

!

( f 0b)

2.4.5 Morphological Hit-or-Miss Transform

The morphological hit-or-miss transform is a basic tool for shape detection. We introduce this concept with the aid of Fig. 2- 16 which shows a set

! indicates the original sets, whereas the shading in Fig. 2- 16 (d) and (e) indicates the result of morphological operations. The objective is to find the location of one of the shapes, say,

!

X. Let the origin of each shape be located at its center of gravity. Let

!

X be enclosed by a small window, W. The local background of

! which is needed later. Fig. 2- 16 (d) shows the erosion of

!

A by

!

X (the dashed lines are included for reference). Recall that the erosion of

!

X is completely contained in A. Interpreted another way, A 0

!

X may be viewed geometrically as the set of all locations of the origin of X at which X found a match (hit) in A. Keep in mind that in Fig. 2- 16

!

A consists only of the three disjoint sets

! 16 (d) and (e) that the set of locations for which exactly fits inside

! intersection is precisely the location sought. In other words, if

! We can generalize the notation somewhat by letting B = (B1, B2), where B1 is the set formed from elements of B associated with an object an B2 is the set of elements of B associated with the corresponding background. From the preceding discussion, B1 = X and B2 = (W " X).

32

AB = (A 0B1) ∩ (Ac 0 B2). (2- 29) Thus, set

!

A B contains all the (origin) points at which, simultaneously, B1 found a match (“hit”) in , the another is, dilation and erosion are duals of each other with respect to set

complementation and reflection, is defined as

!

(A0

!

B)c= Ac " B# (2- 31)

By using the definition of set the differences given in Eq. (2-30) and the dual relationship between erosion and dilation given in Eq.(2-31), we can write Eq.(2-29) as

A ○ B = (A0B1 ) – (A ⊕

!

B"2). (2- 32) The reason for using a structuring element B1 associated with objects and an element B2

associated with the background is based on the aseemption that two or more objects are distinct only if they form disjoint (disconnected) sets. This is guaranteed by requiring that each object have at least a one-pixel-thick background around it. In some applications, we may be interested in detecting certain patterns(combinations) of 1’s and 0’s within a set, in which case a background is not required. In such an instance, morphological hit-or-miss transform reduces to simple erosion. As indicated previously, erosion is still a set of matches, bur without the additional requirement of a background match for detecting individual

objects.

Y

X

Z

Y

A = X∪Y∪Z

Origin

!

(W " X)

Ac Θ (W - X)

(c) (d)

A c

(A0X)

(a) (b)

34

Fig. 2- 16 (a) Set

!

A. (b) A window,

!

W, and the local background of

!

X with respect to

!

W,

!

(W " X). (c) Complement of A. (d) Erosion of A by X. (e) Erosion of

!

Ac by

!

(W " X). (f) Intersection of (d) and (e), showing the location of the origin of

!

X, as desired.

(A Θ X) (A

c Θ (W – X))

(f)

CHAPTER 3 The Proposed Method

3-1 The System Structure

In this chapter we propose a method, which combines morphological hit-or-miss transform and local thresholding. Our objective in this thesis is to propose a method for improving the resolution of a GPR Image. The wave energies reflect non-metallic pipes and are weaker than reflected by metallic pipes when we grasp images by using Penetrating Radar Equipments, thus these images are transformed worse than pipe images.

Aiming at this kind of images, we propose a parabola-shape partial image segmentation way through the comparison of other image enhancement methods. The GPR images we adopt in this thesis are all obtained by SIR-2 GPR system experiments. The flowchart is as follows:

36

Fig. 3- 1 Overview of our proposed method GPR Image: *.dzt

Grey-value Image: 8-bit

Binary Image: Threshold

Detect object:

Morphological Hit-or-Miss Transform Cluster

Object Situation

Compare object’s size

Create Parabola Model

Double Refection Wave Have Noises

Local Enhancement Image

Recover Original Image Filter

In this section, we first introduce properties GPR images. Generally, there are two kinds of underground pipes. One is metal series, including iron pipes in general, which can result in clear hyperbola images when images are transformed because they can reflect higher energy waves. The other is non-metallic series, including plastic pipes made of PVC and PE

materials, which result in more easily weak hyperbola images when images are transformed because they reflect weaker waves than metal pipes. Fig. 3- 2 shows three typical hyperbolas, the signal of IRON pipe is stronger than those of PVC and PE pipes. In the thesis we will focus on the enhancement of PVC and PE pipe images. Because the pipe images obtained by experiments are in shapes of hyperbolas, in the thesis we will attempt to develop an image processing method based on this point.

Fig. 3- 2 Three typical kinds of hyperbolas. From left to right are IRON、PVC and PE

First of all, we try to explain hyperbolas as shown in Fig. 3- 2. From the Fig. 3- 3 it may note that only IRON pipes can grasp complete hyperbolas; otherwise, the hyperbolas caused by PVC and PE pipes have been broken. When the threshold value is lowered, the hyperbolic object can’t be separated from background, the gray values of non-metallic pipe (PVC,PE) image are very similar with background’s. In Fig. 3- 3 (h) we can find that PVE and PE pipes with low contrast have histograms that will be narrow and will be centered toward the middle of the gray scale. IRON pipe images in general are clearer, so it is easily to know the position of pipes when experts compare with them with others. While PVE and PE pipes are much more easily affected by image surrounded and noise, it may cause us investigate the wrong

IRON PVC PE

38

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Fig. 3- 3 (a)-(c) The IRON、PVC、PE PIPE images (d)-(f) The binary image with threshold value: 139、130、131,range with [0,255] (g)-(i) The histogram.

Traditionally, image enhancement methods are worked in spatial domain. We have discussed five main methods for PVC and PE GPR images, which are Prewitt, Sobel,

Laplacian, Morphological contrast enhancement, and Histogram Equalization. Fig. 3- 4 shows the effect of different image processing. First, we mask the positive hyperbola with the red circles in Fig. 3- 4(b), where we can see the enhanced hyperbola is stronger than the original one. From these pictures it is apparent that IRON has well effect for this methods, on the another hand, in Fig. 3- 4 (a) and (e)strengthens little the effect and thus makes PVC and PE images clearer, but the positive hyperbola still is similar with the background in gray value; in Fig. 3- 4 (c) through (d) PVC and PE pipe images are weak when using Prewitt and Sobel. In Fig. 3- 4(e), Morphological contrast enhancement enhances the PE pipes well, the more

significant effect than others. However, it is still weak in PVC pipes. Above methods are not still sturdy. Last of all, it has the remarkable effect when using Histogram equalization (Fig.

3- 4(b)). In these ways, PE pipes have good effects. However, when the whole image is strengthened, the noise is strengthened at the same time in the GPR images. If we don’t denoise it well, weakened hyperbola may easily be eliminated. Therefore, enhancing the whole image does not necessarily optimize the image.

Finally, the GPR image’s histogram shows that it is the low contrast image and shows the GPR image belongs unimodal histogram. On PE and PVC pipes, the hyperbolas are close to background in gray value, it is a question to separate them that we’ll discuss.

(a) (b)

(c) (d)

(e) (f)

Fig. 3- 4 (a) Laplacian operator (b) Histogram equalization (c) Prewitt operator

40

Then we use the same procedure to process another image. First of all, as in Fig. 3- 5(a), two places which have been circled are hyperbolas. The same as in Fig. 3- 5(c), two hyperbola which have been marked with red lines. This is a high contrast and weak image and the pixels value is also similar to background, we found that we cannot separate hyperbolas from

background by using threshold: 136(Fig. 3- 5). And it is still the same situation after using other spatial domain image enhancement method. We hope get the clear hyperbola which has the more difference from background, that help experts easy to distinguish it. Above image enhancement methods can’t satisfy us. In Fig. 3- 4(e), we found the result of morphological contrast enhancement method is fairly good than other traditional methods. Analysis these two images, Fig. 3- 4 belongs to unimodal histogram, but gray levels of histogram of Fig. 3- 5 distributes averagely, object edge is not clear and the image is high contrast, too. Under the condition of Fig. 3- 4, using histogram equalization can produce significant and desirable effect. If using the other 4 methods stated above, image in Fig. 3- 4 can produce the results better than that in Fig. 3- 4, but they still can be improved. This is because that the histogram of Fig. 3- 4 is narrow and the histogram of Fig. 3- 4 is wide. So using histogram equalization can’t get fairly good effect. So, in Fig. 3- 4 can obtain better result than in Fig. 3- 5 using other methods stated above. It is because it has clearer edge in Fig. 3- 4. Meanwhile, Fig. 3- 5 actually cannot achieve desirable result adequately from either method above. In a weakened image, we usually face the problems of hyperbola being similar to the background in gray value, and mistrial problem due to noise image. We introduce hyperbola model to produce regional area to process hyperbolic object, in order to help the experts to distinguish images and solve the above problems. Thus, if we can get the local histogram that only formed by the hyperbola pixels, we don’t care pixels of the background.

(a) (b)

(c) (d)

(e) (f)

(g) (h)

Fig. 3- 5 (a) The original image with two hyperbola (b)The binary image with threshold value:136 (c) Laplacian operator (d) Histogram equalization (e) Prewitt operator

(f) Sobel operator (g) Morphological contrast enhancement (h) The histogram

42

3-2 Image Processing Technique

3-2-1 Hard Thresholding

3-2-1 Hard Thresholding

相關文件