• 沒有找到結果。

Chapter 2 Background and Related Work

2.1 Mathematical Morphology for Erosion, Dilation and Opening

2.1.1 Dilation

Dilation is a kind of binary image of an object to expand in size [19]. This change on how thick and how big the object will be. The size of the change is due to the SE (structuring element).

Mathematically dilation is according to a set operation, the dilation of A by B, denoted asAB.

(a) (b)

B

A

(c) (d)

Figure 2.1 The process of dilation (a) A is dilated by B (b) SE movement path(c) Dilation range (d) Results of dilation

7

For example, let’s see Figure 2.1(a), A is being dilated by B. B is structuring element.

Figure 2.1(b) clearly shows B movement around A’s outline, dark green’s portion describes B’s center location. B’s center point is moving around the area outside of A.

The red section shows the overlap of A. Figure 2.1(c) red portion describes the dilation the final is seen in Figure 2.1(d).

Next we will use dilation to use gray level, the mathematic definition is different in gray level [31, 32]. have to be in the dom alogous to the condition in the b

of dilation, where the two sets have to overlap by at least one element. Note also that the form of Eq. (2-2) is similar to 2-D convolution, with the max operation replacing the sums of convolution and the addition replacing the products of convolution.

We illustrate the notation and mechanics of Eq. (2-2) by means of simple 1-D functions. For functions of one variable, Eq. (2-3) reduces to the expression

)}

Mathematical morphology what the convolution kernel is to linear filter theory. Recall from the discussion of convolution that f(− is simply ( )x) f x mirrored with respect to the origin of the x axis. As in convolution, the function f i( − moves to the right for x) positive s and to the left for negative i .The requirements that the value of (ix) has to

8

be in the domain of f and that the value of x has to be in the domain of imply condition almost always found in practice), the form given in Eq. (2-2) is simp

of indexing and achieves the same ,

ler in terms result. Conceptually f sliding by o different than sliding by

g is really n

g f .

of

dilation. Er

The ef performing on a ray-scale is

twofold: (1) the structur elem e, the output image

depending on how their values and shapes relate to the structuring element used for dila

Erosion is an object in binary image that i

[19] ilar to osion a u

tends to be brighter than the input. (2) Dark

dilation

nd how m

ent are positiv

calculates how the shrink or becom ch er

g

details either are reduced or elim image

osion is used in structuring

Z set and B, 2 A A is being eroded by B becomingAB, is defined as

ation shows A bei oving according the c, ts.

(a) (b)

B

A

(c) (d)

Figure 2.2 The process of erosion (a) A is erosion by B (b) SE movement path (c) Erosion range (d) Results of erosion

For example, let’s look at Figure 2.2(a), A is being dilated by B, thus, B is so called structuring element and so is SE. Figure 2.2(b) clearly shows B is on the outline moving around A. The center of B is moving around section A. In this figure, B’s center is

10

marked green. The section marked red is where B overlaps A. Figure 2.2(c) the section marked red is where A is eroded by B. The results are seen in Figure 2.2(d).

Next, it is the same as before where erosion is used on the gray level images, and the definition is different [31, 32].

The erosion method is the same as dilation, the difference between them both is to narrow the objects in the images, here we use the basic part. We have a detailed description as above.

Gray-scale erosion, denoted f  g , is defined as have to be in the dom alogous to the condition in the b y def nition of erosion, where the structuring element has to be complete contained by the set being eroded. Note that the form of Eq. (2-5) is similar in form to 2-D correlation, with the min operation replacing the sums of correlation and subtraction replacing the products of correlation.

We illustrate the mechanics of Eq. (2-6) by eroding a simple 1-D functions. For functions of one variable, the expression for erosion reduces to

)} right for negative . The requirem

i

i (i+ have to be in the domain of f and x)

11

x have to be in the domain of imply that the range of is completely contained within the range of the displaced

g g

f .

Finally, unlike the binary definition of erosion, f rather than the structuring element , is shifted. Eq. (2-5) could be written so that is the function

lated, resulting in a mo licated expression in term of indexing. Because

g g

The general effect of perform ng erosion on a gray-scale image is twofold: (1) If all the ents of the structuring element are positive, the output image tends to be darker than the input image. (2) The effect of bright details in the inpu age that is smaller in area than the structuring element is reduced, with the degree of the reduction being determined by the gray-level values ht detail and by the shape and amplitude values of the structuring elem lf.

2.1.3 Opening

As previously discussed, dilation is expanded on age. On the other hand, erosion is shrinking on an object in the image. A is being opening by B is defined on

athematically morphology. This is the defined as 。 i

This is A being eroded by esults in the dilation of

Opening is from mathem orphology. Dilations often expand on an image and

erosions shrinks. However, portant oothes the

contour of an object and eliminates thin protrusion.

The two most common structuring elements (given a Cartesian grid) are the

B, and it r B.

to note that opening generally sm atical m

it is im

12

4-connected and 8-connected sets, N4 and N8, seen in Figure 2.3. Of course there are several different kinds of structuring elements. Different situations will be analysis to use different kinds of structuring elements.

(a) (b)

Image segmentation divides images into different numbers of sub-images, area and objects. This step is the most important step in image processing. Image segmentation algorithms are based on two main properties: discontinuity and similarity [19, 31, 32].

The first properties are to partition an image based on its abrupt changes in intensity. This is seen in edges in an image. The second property is on partitioning an image into regions that is a set of predefined criteria. Thresholding, region growing, and region splitting and merging are examples of methods in both these properties. Next we will deal with the topic of Sobel edge detection’s method.

Edge detection is a method that uses difference of adjoining pixels to find out the edge [2].The difference is bigger, the edge is clearer. Otherwise, the difference is small, the edge is not clear.

Edge detection is by far the most common approach for detecting meaningful discontinuities in gray level .In this section we discuss approaches for implementing first-and second-order digital derivatives for the detection of edges in an image [19]. In image processing we have to calculate first order derivatives equals the calculation called gradient. The gradient of an image f(x, y) at location (x, y) defined as the vector

x y f f

It is well known from vector analysis that the gradient vector points in the direction of maximum rate of change off at coordinates(x, y).

An important quantity in edge detection is the magnitude of this vector, denoted fm∇ , where

∇ =mag ( ffm ∇ )=[Gx2+Gy2 1]/ 2

2 1/ 2

=[(∂ ∂f / x)2+ ∂ ∂( f / y) ] (2-9)

For simplifying the calculation, sometimes the equations underneath is used as replacements.

fmGx2 +G2y (2-10)

fmGx + Gy (2-11)

According to R. C. Gonzalez and R.E. Wood’s book “Digital Image Processing” [31,

14

32], meaningful edge is depended on the changeable gray level is bigger than the background. Therefore, we have to define on an image’s edge point, looking at its two dimensional one order derivatives value is bigger than a specified threshold.

The Sobel Edge Detection being introduced today belongs to a technology in image segmentation. Simply said, in Figure 2.4, (a) is a 3x3 region of an image where p’x are

the gray level values and (b), (c) is a calculation of near absolute one order derivatives Gx and Gy mask. The gradient can be computed as seen below.

15

Figure 2.4 Sobel edge detection (a) A 3x3 region of an image (p’s are gray-level values) (b) Gx mask(c) Gy mask

2.3 Thresholding of Image Segmentation

Due to its intuitive properties and simplicity of the implementation image thresholding has a central position in the applications in image segmentation. We have to get the object

from the background and the rest is left over. Extracting the object from background is to select a threshold T that separates object points and background points. The object any point 2D’s coordinate (x, y) for which any point f( ,x y)>T is the object point.

Otherwise the point is called a background point.

In this paper, we will use Nobuyuki Otsu’s method to calculate the threshold [9, 11, 25].

The method is a non-parametric and unsupervised method of automatic threshold selection for picture segmentation. An optimal threshold is selected by the discriminate criterion, namely, so that it maximizes the separability of the resultant classes in gray levels. The procedure is very simple, utilizing only the zeros and the first-order cumulative moments of the gray-level histogram.

For this method gray level histograms can be seen as a probability density function seen underneath [19]:

where the range is collection are 1… L-1] . Otsu’

and

is the amount from the which is the pixel value.

L represents the total nu et’s assume reshold value k, and

using two sets [0, 1... k-1] and the second set

where its range is [k, k+ s method is find k value where k is a threshold, which separates two classes: . Then after obtaining the two classes, calcu the between-clas iance. en k value will make

r q

Where

2.4 K-means of Clustering of Data Mining

Data mining is also called Knowledge Discovery in Databases (KDD), which is defined: Extracting the unknown valuable information which is hidden from the data [14]. ”Data mining is also obtained by automatic or semi-automatic data collection and massive data analysis for establishment of a valid model” [13]. Data mining commonly involves four classes of task: 1. Classification, 2. Clustering, 3. Regression, and 4.

Association rule learning. In this research paper we use the technique of clustering, which is also what is introduced below as K-means algorithm.

The K-means algorithm assigns each point to the cluster whose center (also called centroid) is nearest. The center is the average of all the points in the cluster — that is, its coordinates are the arithmetic mean for each dimension separately over all the points in the cluster.

The algorithm steps are [1]:

Step1: Specify the number of cluster, k

17

Step2: Randomly generate k clusters and determine the cluster centers .Assign each point to the nearest cluster center.

Step3: Use the leftover to assign each point to nearest cluster center to classify into a cluster.

Step4: With every present cluster information, recomputed to find the new cluster center.

Step5: If the convergence situation is not reached repeat step 3 to step 5, until convergence situation is met. (Convergence situation is met when the k group does not change.)

Figure 2.5 The flowchart for K-means algorithm

18

19

Chapter 3 Automatically Generate a Simplified Chest Atlas from the Chest Computed Tomography Using

Morphology, Image Segmentation and K-means

Medical image is used for medical research and medical treatment. Using imaging, this would allow medical staff to get a view of the interior of human without opening.

In 1895 a German physician, Wilhelm Roentgen, discovered X – rays and opened a new era in medical field [15]. From then on, doctors would able to get a view of the interior without doing operations. Before X – rays, risks were high as touching and operating on the human was very common.

Medical imaging is developing until today, apart from angiography, cardiac angiography, computerized tomography, dental radiography, fluoroscopy, mammography radiography, there are sill position emission tomography and single photon emission tomography.

This paper’s research is conducted through CT’s DICOM files provided by cooperating with doctors.

3.1 Introduction

In this chapter we use different kinds of image processing methods and collected data mining method called K-means. This would gradually allow us to achieve chest CT atlas.

Firstly use the method of similar to the opening method which is also continuously

20

eroding and dilating. We can eliminate the platform in the CT. Then two steps are used, Sobel edge detection is used for giving the outline. After that we use Otsu’s method to gain gray threshold’s value. This would allow us to eliminate the unwanted body parts and get the body parts we need in the CT.

Next using the two photos for binary image and operate AND in morphology. In other words, we just need the edges and the bone portion. After that we calculate the non-zero coordinates as an input. Use K-means algorithm to group the coordinates, and get each centroid’s location as an output on the location of the image. Then order the centroids, based on the book about anatomy [8, 12, 17], add the locations and the description of each location. In conclusion we will achieve the chest CT image as an atlas.

Figure 3.1 The flow chart for proposed method

3.2 The Experiment Steps

According to the research steps mentioned above, we used the chest CT provided by the doctors. A total of 10 patients, there is six males and four females. The biggest gray level is 216− . We took the clearness of the images into consideration and location of the 1 organ in the body’s symmetry. After that after taking all these into consideration, we than would understand how many clusters we need. We needed the cluster number were six

21

22

and five clusters. The program we used were MATLAB to simulation the results and displaying the results.

3.2.1 Similarities to the Opening Method

The CT provided by the doctors were patients lying on a platform. This can be seen in figure 3.2(a). This would alternate the results. So we would have to eliminate the platform, so that an accurate result would be gained. All images were unable to be conducted so only one patients image were provided to show the result.

We used a technique similar to the opening [28], first using several erosion than the method several dilation to eliminate the platform. Before using the technique similar to opening, a threshold of 150 was used to use the pixel that has a smaller value as a background. This would allow pixels values that are smaller or other outlier pollutants to be ignored. This would speed up the proposed technique and getting a faster result. This paper used N4 as structuring element to be tested.

(a) (b)

Figure 3.2 (a) Typical chest CT (b) Platform used in image capture (Source:http://en.wikipedia.org/wiki/File:64_slice_scanner.JPG)

1

1 1 1

1

Figure 3.3 The standard structuring elements (SE) N4

Table 3.1 A simple dilation and erosion rule of using N4 as SE

Operation Rule Dilation Easily said the output is the input of pixel neighboring (up, down, left,

right and itself) of the biggest pixel value which replaces the original pixel. If binary image, the neighboring points, if a pixel is not the background, if it isn’t zero, the operated pixel will be replaced by 1.

Erosion Easily said the output is the input of pixel neighboring (up, down, left, right and itself) is the smallest pixel value which replaces the original pixel. If binary image, the neighboring points, if a pixel is the background, if it is zero, the operated pixel will be replaced by 0.

23

24

According to binary image’s dilation, as seen in Table 3.1, this provides a prompt discussion. The three tables in Figure 3.4 show the dilation process. We use a pixel for this discussion. This pixel is marked by arrow heads. In Figure 3.4(a) we can see this pixel is neighbored by green marked pixels. The red marked is neighbored by foreground pixel, thus the pixel that is being treated (marked red) will be transformed into a foreground pixel. In Figure 3.4(b) after treating all the pixels in the image, the results can be seen in 3.4(c).

According to gray level imaging we will use Figure 3.5. We use a pixel for this discussion. This pixel is marked by black arrow heads. In Figure 3.5(a), in the table seen above, the pixel’s value will be overtaken by the biggest value in its neighboring pixels as seen in Figure 3.5(b). In Figure 3.5(c) are the results after treating all the pixels in the image.

Next, we will be discussing about erosion. Figure 3.6 shows erosion in the binary image, the black arrow head shows the pixel. The neighboring pixels include background pixels, so the black arrow head pixels will be background pixels as seen in Figure 3.6(b).

The results can be seen in Figure 3.6(c).

According to the erosion on gray level image, the black arrow head show the pixel will be overtaken by the smallest pixel value in the neighboring pixels. As seen in Figure 3.7(b). The results can be seen in Figure 3.7(c).

(a) (b)

25

(c)

Figure 3.4 The dilation process for a binary image:

(a) The original binary image, according to the arrow heads pixel for dilation process.

(b) As the neighboring pixel is foreground pixel, so the value 0 is overtaken by 1.

(a) (b)

26

(c)

Figure 3.5 The dilation process for a grayscale image:

(a) The original gray level image, according to the arrow head pixel for a dilation process.

(b) As the neighboring pixel value, the biggest value will overtake the arrow head pixel.

(c) Results.

(a) (b)

27

(c)

Figure 3.6 The erosion process for a binary image:

(a) The original binary image, the arrow head pixel is being used in an erosion process.

(b) As the neighboring pixel is a background one, 1 will be overtaken by 0.

(c) Results.

1 0 0 1

1 1 1 0 0

0 0 1 0 0

0 0 0 1 0 0 0 0 1 0 0 0 1 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

(a) (b)

28

(c)

Figure 3.7 The erosion process for a grayscale image:

(a) The original grayscale image, the pixel marked by the arrow heads is being used in the erosion process.

(b) According to the neighboring pixel value, the smallest value will be overtaken.

(c) Results.

191 134 164 122 3

21 23 187 4 29

10 9 11 133 27

69 35 17 144 21

42 78 222 61 73

134 187 122 187

21 23 122 3 3 10 9 4 4 3 9 9 9 4 21 10 9 11 17 21 42 35 17 61 21

Due to the erosion process was not conducted thoroughly the platform in the image would not be able to be deleted. However, if the erosion process was conducted was conducted over thoroughly, after dilation the details in the image will still is lost. How many times we repeat the process is a topic that can be further discussed. After testing numerous times, and the optimal number of process is 13 times. This means doing a process of erosions 13 times and straight after doing the process of dilation 13 times.

The results can be seen in Figure 3.8.

(a) (b)

Figure 3.8 Delete the platform (a) Original patient 1 chest ct (b) Result of our method

In Figure 3.8 we can see the original patient 1 CT and the results of the method similar to opening. The experimental images in this chapter is all according to patient 1 unless noted otherwise.

29

3.2.2 Sobel Edge Detection

? gT

Figure 3.9 The flow chart for Sobel algorithm

Eliminating the platform, thus will leave the parts where will be processed, this is also the body.

The flow chart for Sobel algorithm is shown above. This is a edge detection methos which uses the calculation of a gradient, and we choose a threshold to see if the gradient is bigger than the threshold. This will show if this is an edge point.

Before this we will need a Threshold, T’s value to determine a Sobel algorithm’s process result. After numerous experiments on a number of T values, as seen in Figure 3.10, we have decided to use the T value of 100000. This value might be a big threshold, however, we don’t need all the detail edge in the image. So the Sobel process shouldn’t be conducted too sensitive.

..

30

(a) (b)

(c)

Figure 3.10 Use Sobel detection on different theshold,T (a) T=0 (b) T=10000 (c)T=100000

31

32

3.2.3 Thresholding

The above section, we get the after edge detection processed image. This image before it went through the edge detection process has already eliminated the platform. We used this image in the steps afterwards; however, the results were not acceptable.

Use the results mentioned above seen in Figure 3.11(a), the arrow heads shows the

Use the results mentioned above seen in Figure 3.11(a), the arrow heads shows the

相關文件