• Aucun résultat trouvé

Otsu Algorithm

Dans le document European Journal of Scientific Research (Page 48-52)

Automated Segmentation of Lungs in Computed Tomographic Images

3. Otsu Algorithm

The proposed method of lung segmentation uses Otsu thresholding and other techniques of digital image processing. A brief overview of how Otsu algorithm works is explained below [16]:

1) Calculate histogram and probability of each intensity level.

2) Set up initial values i(0)andi(0).

Otsu thresholding [16] is used to attain a threshold value that divides image into two categories of pixels, i.e. foreground and background. We increment threshold value step by step to reach a threshold value that gives maximum variance between pixels of the two classes. A value that yields optimum outcome is taken [16] the one that results in maximum variance between pixel values of the two classes.The splitting up of pixels into two separate classes C0 and C1 using threshold k generates two categories of pixels namely C0, specifying pixels having levels [1,…k], and C1 representing pixels having levels [k+1,…L]. The likelihood of class occurrences are given by probabilities:

0 Pr

 

0 k1 ( )

The variances of class are represented by the following equations:

 

2 variance [16] given by eq. 7, 8 and 9 for the evaluation of integrity of the threshold:

 

The optimal threshold which maximize [16] the between-class variance and lessens the intra-class variance is:

The flowchart in figure 1 depicts our proposed automated lung segmentation scheme. The dataset used is taken from the Cornell University, USA‘s database. Fifteen (15) datasets are used, where every scan is composed of 200 to 230 slices. Every slice is an512 512 image. To attain lung area the proposed

Both lungs are generally separated after the previous step. If lungs are not discriminated from other areas, we use Otsu thresholding again with extremely small increments in threshold value. We then use connected component labeling method. Otsu procedure keeps on executing till we get greater than two objects in the image. Our technique considers lung parts dispersed because of overlap of anatomical configuration. This is done by computing main image‘s centroid and centroid of retained regions. After this, we make comparison of their vertical and horizontal coordinates. For further processing while also avoiding under-segmentation and over-segmentation, morphology procedures are used alongwith bitwise logical operators. Each step involved in the proposed method is explained below.

Figure 1: Flowchart of proposed scheme

Pre processing

Thresholding

Noise/ Trachea/

Airway Removal

Obtaining Lung Area

Right and Left Lungs separated?

Separating Right and Left Lung using centroid

Smooth Right and Left Lungs Adjust

Thresho ld value

N o

Y

4.1. Pre-Processing

The first stage of this research work is the image processing step. The main objective of the pre-processing stage is to enhance the quality of the image and enhance the important image features and suppress the undesired ones. First preprocessing is applied to the original CT scan image. Both lungs and their nearby portions are areas of interest and pixel values external to this area being insignificant are removed. The resultant image appears as shown in figure 2a.

4.2. Thresholding

The next step is applying thresholding to the image to achieve two categories of pixels in the image or a binary image. After application of thresholding to image shown in figure 2a, we obtain the image shown in figure 2b.

4.3. Noise, Airway/ Bronchi Removal

During acquisition or digitization process of CT scan images a noise could be introduced that needs to be reduced. An appropriate filter need to be chosen which can enhance the image quality even for non-uniform noise, like salt and pepper noise, and also preserve the important edges. Figure 2b indicates

the presence of noise and other components, i.e. airways and bronchi in the image. These components are to be eradicated. It is evident that two major objects in the thresholded image are both lungs.

Connected component analysis is applied here. The connected component labeling algorithm assigns distinct labels to all the regions in the image so as to manipulate the regions fulfilling the specific criteria set for regions. Keeping this in view, we extract the two largest components. To obtain the two large components and simultaneously remove other components, size of minimum component is put equal to 1500 pixels. Objects containing pixels greater than 1500 are kept while other components are removed. After removal of the small components, there are two objects, i.e. the two lungs in the image.

At this point, we might acquire only one object if lungs were partially fused.

Figure 2: (a) CT scan image of thorax (b) After thresholding(c) Noise/ Trachea/ Airway Removal

(a) (b) (c)

Figure 3: (a) Left lung segmented and smoothed (b) Stuff inside left lung (c) Boundary of left lung (d) Right lung segmented and smoothed (e) Stuff inside right lung (f) Boundary of right lung

(a) (b) (c)

(d) (e) (f)

4.4. Boundary Refinement & Internal Content Preservation

These steps are essential to process the border of lungs and maintain their internal structure.The internal structure of lungs may be helpful under some circumstances, for example to visualize the blood vessels in lungs. The technique in this step also eradicates under segmentation and oversegmentation. This process has two parts:

Edges of the lung obtained during previous step are uneven. For more refined results, the border of lungs has to be smoothed. For smoothing lungs, morphological close operation is applied to the image. This generates the lungs with smooth boundaries. The resultant images are shown in figures 3a and 3d.

mode. To conserve the implicit structure of lungs we use the logical operator AND on the images of left and right lungs, shown in figure 3a and 3d, with the image of figure 2b. The acquired images of left and right lungs are shown in figure 3b and 3e.

4.5. Boundary Extraction

We apply Sobel operator for extracting the boundary of the left and right lungs given in figures 3c and 3f. At this point, there are two classes of images.There are images illustrating edges of the lungs and the imagesshowing implicit structure of both the lungs. Apply bitwise OR to the border image and internal area of lungs, i.e. take bitwise OR of figure 3b with 3c and that of figure 3e with 3f. This would give finally segmented left and right lungs shown in figures 4a and 4b.

Figure 4: a) Complete left lung segmented b) Complete right lung segmented

(a) (b)

4.6. Disjoint in Right Lung (A Special Case)

In exceptional cases in CT slices, a lung is contained in more than one part as depicted in the figure 5a.

This special case is dealt with by computing the centroid of objects or regions in the image. The whole process of segmenting this type of lung is explained below:

Centroid can be called any entity‘s center from the viewpoint of geometry. Within triangle,

where A is the area of the polygon, given by:

1

Comparison of the vertical coordinate of image and all regions is done. The regions where centroid‘s vertical coordinate has higher value than the vertical coordinate of image, we allocate it to right lung.

In same way, region where centroid‘s vertical coordinate is less than that of main image we allocate it to the left lung.

Figure 5: a) CT scan image containing disjoint in right lung (b) After thresholding (c) Noise/ trachea/ airway removed (d) right lung segmented and smoothed (e) Boundary of right lung (f) Stuff inside right lung

(a) (b) (c)

(d) (e) (f)

Figure 6: Complete Right lung segmented

Dans le document European Journal of Scientific Research (Page 48-52)