• No results found

Implementation of gray-level clustering algorithm for image segmentation

N/A
N/A
Protected

Academic year: 2021

Share "Implementation of gray-level clustering algorithm for image segmentation"

Copied!
7
0
0

Loading.... (view fulltext now)

Full text

(1)

Computer

Science

Procedia Computer Science 00 (2009) 000–000

www.elsevier.com/locate/procedia

* Corresponding author. Tel.: +91-44-22461404; fax:+91-44-22461904. E-mail address: [email protected].

ICEBT 2010

Implementation of Gray-level Clustering Algorithm for Image

Segmentation

A.R. Kavitha

a

*, C. Chellamuthu

b

a Jerusalem College of Engineering, velachery main road, Chennai.600100, India b R.M.K College of Engineering ,karaipettai, Thiruvallur dist,India

Abstract

The watershed algorithm is an important technique for image segmentation which converts the gray-level image to a segmented image. We propose a watershed algorithm based on the mean value, the standard deviation of the histogram and the PSNR within a sub-interval, a novel recursive algorithm for deriving clustered images that is also used to increase the quality of an image. The clustered images using the watershed algorithm produce close results to that of the original image.

Keywords: Watershed algorithm; Image processing; clustering algorithm; image segmentation; histogram.

1. Introduction

A clustered image can be used in many applications like satellite image clustering is used for classification of geology is to measure the area on forest or cultivated land. Color image segmentation based on automatic morphological clustering is used for various applications [11].

There are two types of image clustering. The first type is based on gray-level which includes single thresholding and Multi-thresholding. Single thresholding transforms original image to binary image. The multi-thresholding [15] classifies the gray-level into several intervals. Otsu is the most classic method it takes lot of time to complete the multi-thresholding process. Arora [12] is a quick multi-thresholding algorithm to solve the gray-level problem.

The second type of image clustering is based on k-means algorithm [14] in solving the gray-level problem but the number of cluster and initial set of each cluster center must be set by a human. The final output set of each cluster in the k-means algorithm takes long time to be implemented based on two-layer pyramid data structure. Dong‘s algorithm [13] finds the image cluster from the lower resolution image and then extends it to the higher resolution image.

The proposed Watershed algorithm is presented in this section 3 applies the Watershed algorithm and the compared algorithm to several sample images.

2 Proposed Algorithm

An M × N resolution digital image may be defined as a two-dimensional function where x and y are spatial coordinates, and the amplitude of F at any pair of coordinates(x,y) is the gray level of the image at that point. Thus the array of an original input image F(x,y) is

c

⃝2010 Published by Elsevier Ltd

Procedia Computer Science 2 (2010) 314–320

www.elsevier.com/locate/procedia

1877-0509 c⃝2010 Published by Elsevier Ltd doi:10.1016/j.procs.2010.11.041

Open access under CC BY-NC-ND license.

(2)

.

.

F (M-1, 0) F (M-1, 1)…F (M-1, N-1)

Kernel can be virtually any size (3x3, 5x5, 5x7, 15x15, whatever), but 3x3 sizes are generally the most useful--they operate only on a pixel and its directly adjacent neighbours. Convolution requires a lot of computational power. To calculate a pixel for a given mask of size m x n, m * n multiplications, m * n - 1 additions, and one division are required. So to perform a 3 x 3 convolution on a 1024 x 1024 colour image (a minimal convolution on an average-size image), 27 million multiplications, 24 million additions, and 3 million divisions are performed. For more substantial convolutions, such as 5 x 5 or 8 x 8, on larger images the amount of computation required becomes very large indeed. The process flow can be displayed in the Fig 1

Fig. 1 Process Flow

2. Image Pre-processing

Kernel can be virtually any size (3x3, 5x5, 5x7, 15x15, whatever), but 3x3 sizes are generally the most useful--they operate only on a pixel and its directly adjacent neighbours. Convolution requires a lot of computational power. To calculate a pixel for a given mask of size m x n, m * n multiplications, m * n - 1 additions, and one division are required. So to perform a 3 x 3 convolution on a 1024 x 1024 color image (a minimal convolution on an average-size image), 27 million multiplications, 24 million additions, and 3 million divisions are performed. For more substantial convolutions, such as 5 x 5 or 8 x 8, on larger images the amount of computation required becomes very large indeed.

3. Edge Detection

The first step is to filter out any noise in the original image before trying to locate and detect any edges. A convolution mask is usually much smaller than the actual image. As a result, the mask is slid over the image, manipulating a square of pixels at a time. After eliminating the noise, the next step is to find the edge strength by taking the gradient of the image. Then, the approximate absolute gradient magnitude (edge strength) at each point can be found. The 3x3 convolution masks, one estimating the gradient in the x-direction (columns) and the other estimating the gradient in the y-direction (rows). They are shown below:

Input Image

Image pre-processing

Segmentation

(3)

The gradient is then approximated using the formula:

|G| = |Gx| + |Gy| (2) Finding the edge direction is trivial once the gradient in the x and y directions are known. However, you will generate an error whenever sumX is equal to zero. So in the code there has to be a restriction set whenever this takes place. Whenever the gradient in the x direction is equal to zero, the edge direction has to be equal to 90 degrees or 0 degrees, depending on what the value of the gradient in the y-direction is equal to. If GY has a value of zero, the edge direction will equal 0 degrees. Otherwise the edge direction will equal 90 degrees. The formula for finding the edge direction is just:

θ = arctan (Gy / Gx) (3) Once the edge direction is known, the next step is to relate the edge direction to a direction that can be traced in an image. So if the pixels of a 3x3 image are aligned as follows:

x x x x a x x x x

Then, it can be seen by looking at pixel "a", there are only four possible directions when describing the surrounding pixels - 0 degrees (in the horizontal direction), 45 degrees (along the positive diagonal), 90 degrees (in the vertical direction), or 135 degrees (along the negative diagonal). So now the edge orientation has to be resolved into one of these four directions depending on which direction it is closest to (e.g. if the orientation angle is found to be 3 degrees, make it zero degrees). 4. Watershed Segmentation

Thus the watershed algorithm is provided the image C(f) which was obtained from the Marker image M(f) and the Final Gradient image, FG(f). For any pixel p at position (i, j), C can be obtained by

( )

(

( )

( )

( )

)

( )

( )

⎪⎩ ⎪ ⎨ ⎧ + = f M f M f FG f M f FG f C p p p p in white is p ; 2 1 in black is p ; (2)

Since the Marker image, M(f) provides a rough partition of the objects, the final gradient image, FG(f) avoids over merging and the average of the Marker and Final Gradient images preserves the contour of objects, C(f) ensures that both interior and contour of an object will be detected as it should be. The image C thus obtained is then subjected to watershed segmentation. The segmented output is more pleasing without over-segmentation and the algorithm is also less time-complex than other traditional algorithms.

Effective Watershed algorithm Input : Original image Output : Segmented image

Step1 : Calculate the gradient magnitude image by evaluating the magnitude at each image point. Step2 : Start at threshold T=1.

Step3: Find pixels above threshold and pixels below or equal to T. Step 4: Let T=T+1.

Step5: If a region of pixels above T combines with a region of pixels below or equal to T, then mark as a watershed boundary. Step6: Repeat until highest gradient magnitude is reached (T=K-1)

Watershed segmentation is a morphological based method of image segmentation. In the proposed segmentation technique, watershed segmentation algorithm is enriched with additional information about the regions of interest through the preprocessed gradient image and the marker extracted image. Gradient image provides the variations in gray level to segmentation algorithm and the marker extracted image without irrelevant minimal gray-level details causes watershed segmentation to produce more perfect results.

5. Applying PSNR Values

The peak signal-to-noise ratio (PSNR) is the typical method of measuring image quality improvement. MAXI is the maximum possible pixel value of the image (here 255).MSE is mean squared error.

(4)

6. Entropy Calculation

Select an image Lena Leans = 0 commns = 3770 PSNR = 20*Math.Log10(255 / RMSE) k-means algorithm = "33.14" Dong’s algorithm = "33.57" Arora algorithm = "29.72" Proposed algorithm = 36 sumval1 = 0 values = 0 pvalue = 0 valuess = 0 RMSE=Math.Sqrt(values / sumval1) PSNR = 20*Math.Log10(255/RMSE) 7. Experimental Results and Analysis

In order to prove the usefulness of the watershed algorithm different images with 512x512 resolution and gray level is 256 are used for experiments.

Fig. 2. Peppers Images - Color Image

Figure 2 is original image of peppers. It is possible to construct (almost) all visible colors by combining the three primary colors red, green and blue, because the human eye has only three different color receptor.

(5)

Fig. 4. Noise removed Image

Fig. 5. Edge Detected Image

Fig. 6. Segmented Image 8. Analysis (Applying PSNR Value)

Peak Signal Noise Ratio (PSNR) is defined as the process which it reduces the noise in image and increases the quality of image to attain the best performance close to the result. The PSNR value is high based on the output by applying watershed algorithm compared to all other models. The peak signal-to-noise ratio (PSNR) is the typical method of measuring image quality improvement.

MAXI is the maximum possible pixel value of the image (here 255).MSE is mean squared error. Peak Signal – Noise – Ratio

(4) ⎟⎟ ⎟ ⎟ ⎟ ⎠ ⎞ ⎜⎜ ⎜ ⎜ ⎜ ⎝ ⎛ − ⋅ ⋅ ⋅ =

∑ ∑

N= = i M j j i x j i x M N PSNR 1 1 2 2 | ) , ( ˆ ) , ( | 255 log 10

(6)

SNR = a + b*bit + c*bit2

+ d*bit

3 (5)

Average PSNR difference in dB over the whole range of bit rates. Average bit rate difference in % over the whole range of PSNR.

9. Performance Evaluation

Table 1. Performance Evaluation

Image/algorithm K-means Dong’s Arora proposed

Leena 33.14 33.57 29.72 36 balloon 33.27 33.43 29.03 34 Jet 30.79 30.79 26.26 31 Peppers 31.78 32.35 28.25 33 washbowl 32.96 32.81 28.72 34 Sum 161.94 162.85 142.01 168 Average 32.388 32.59 28.4.2 33.6

The performance evaluation cab be completed using the various existing algorithm with proposed algorithm .The tested results are displayed in a above table 1 and the chart representation of performance evaluation can be displayed in a fig 7

0 20 40 60 80 100 120 140 160 180

K-means Dong’s Arora proposed

Leena ballon Jet Peppers washbowl Sum Average

Fig 7. Performance Evaluation

(7)

10. Conclusion

Based on the mean value, standard deviation, and PSNR, a Watershed algorithm is proposed in this paper for image segmentation. Evaluation results show the proposed algorithm succeeds in deriving clustered images. The clustered image built by the proposed algorithm is extremely close to that of original image. The algorithm also reduces the RMSE much more than other schemes, which makes it better suited for real equipment with lower gray-level displaying screen.

References

[1] Ujjwal maulik,”medical image segmentation using genetic algorithm”, IEEE Trans in bio-medicine, vol-3 mar-2009. [2] Ting-lei huang, xue bai,”an improved algorithm for medical image segmentation”IEEE Trans, page 289-291, 2008. [3] Wen-xing king Qing yang,”the comparative research on image segmentation algorithms, IEEE Trans, pp707-707, 2009. [4] Zhao wencang and Wei hongli,”study of image segmentation algorithm based on multi wavelet”, IEEE Trans, pp

2325-2328, 2008.

[5] James c.hilton,”Analysis of hierarchically related image segmentation”, IEEE Trans, pop 60-69, 2004.

[6] Zou kaiqi, wang zhipping,”An improved FCM algorithm for color image segmentation algorithm, IEEE Trans, 2008. [7] Ghassan hamernah and Chris Macintosh,”physics-based deformable organisms for medical image analysis”,pp 326-334. [8] Shinn-ying hoand kual-zheng lee,”an efficient evolutionary image segmentation algorithm”, IEEETrans,pp 1327-1334,2001 [9] Ujwal maulik and sangamitra,”multiobjective clustering for pixel classification in remote sensing imaginary.

[10]T.G’eraud, P.-Y.Strub, J.Darbon,”color image segmentation based on automatic morphological clustering”.

[11]S.Arora, J.Acharya, A.Verma, Prasanta K.Panigrahi,”multilev m.abalafar and abd rah man ramli el Thresholding for image segmentation through a fast statistical recursive algorithm”.

References

Related documents

The results showed that in comparison with the control (touching marble material), touching hinoki wood significantly decreased the oxy-Hb concentration in the left prefrontal

The Transition Department supports a continuum of services for students seeking an Option 1 Special Diploma including: Community Based Instruction, Career Based

pteronyssinus (Dpt), in response to neryl formate (Nf), either tested versus a solvent control or a conspeciÞc extract containing neryl formate at an identical level (extract; Dfm ⫽

Service Benefits of Accelerated Transfusion Clinical/ Social Need Tension Appropriate Use of Patient Time Patient Preference Patient Needs Service Capacity Pressure

IMPORTANCE Short-term outcome studies of antipsychotic dose-reduction/discontinuation strategies in patients with remitted first-episode psychosis (FEP) showed higher relapse rates

The data used in the study is based on historical trajectories of taxicabs managed by Taxi Berlin, Berlin’s largest taxi association dispatching roughly 70% of the city’s taxi

On behalf of the University of Houston College of Business Foundation we thank you for your generous gift to the Wolff Center for Entrepreneurship’s program to educate the

The minimum physiological loss in weight was observed in peach fruits treated with calcium chloride @ 1.5% (three sprays), which was at par with fruits treated with calcium