Image Segmentation Based on Adaptive K-Means Algorithm Xin Zheng, Qinyi Lei, Run Yao, Yifei Gong and Qian Yin*

Image Segmentation Based on Adaptive K-Means Algorithm Xin Zheng, Qinyi Lei, Run Yao, Yifei Gong and Qian Yin*

Zheng et al. EURASIP Journal on Image and Video Processing (2018) 2018:68 EURASIP Journal on Image https://doi.org/10.1186/s13640-018-0309-3 and Video Processing RESEARCH Open Access Image segmentation based on adaptive K-means algorithm Xin Zheng, Qinyi Lei, Run Yao, Yifei Gong and Qian Yin* Abstract Image segmentation is an important preprocessing operation in image recognition and computer vision. This paper proposes an adaptive K-means image segmentation method, which generates accurate segmentation results with simple operation and avoids the interactive input of K value. This method transforms the color space of images into LAB color space firstly. And the value of luminance components is set to a particular value, in order to reduce the effect of light on image segmentation. Then, the equivalent relation between K values and the number of connected domains after setting threshold is used to segment the image adaptively. After morphological processing, maximum connected domain extraction and matching with the original image, the final segmentation results are obtained. Experiments proof that the method proposed in this paper is not only simple but also accurate and effective. Keywords: Image segmentation, Adaptive K-means, Clustering analysis 1 Introduction of background. Meanwhile, a new method which deter- Image segmentation refers to the decomposition of an mines the value of K in K-means clustering algorithm was image into a number of non-overlapping meaningful areas proposed. The image segmentation method proposed in with the same attributes. Image segmentation is a key our paper is widely applied and has achieved good results technology in digital image processing, and the accuracy in the field of food image. of segmentation directly affects the effectiveness of the follow-up tasks. Considering its complexity and difficulty, the existing segmentation algorithm has achieved certain 1.1 Related work success to varying degrees, but the research on this aspect The traditional image segmentation algorithm mainly in- still faces many challenges. Clustering analysis algorithm cludes the segmentation method based on the threshold divides the data sets into different groups according to a value [1], the segmentation method based on the edge [2] certain standard, so it has a wide application in the field of and the segmentation method based on the region [3]. image segmentation. Because image segmentation technology is closely related Image segmentation as one of the key technology of to other disciplines in the field of information, such as the digital image processing, combined with relevant profes- mathematics, pattern recognition artificial intelligence, sional knowledge, is widely used in machine vision, face computer science, and other disciplines in the production recognition, fingerprint recognition, traffic control sys- of the new theory and technology, a lot of segmentation tems, satellite image positioning objects (roads, forests, technology combing special theory appeared. The im- etc.), pedestrian detection, medical imaging, and many proved algorithm proposed in this paper utilizes the the- other fields, and it is worthy of in-depth study to explore. ory of cluster analysis [4]. Cluster analysis is an important Based on the original method, our algorithm proposed human behavior. As early as childhood, one can learn in this paper improves both the accuracy of image seg- how to distinguish different kinds of things by constantly mentation and algorithm structure. The luminance com- improving the subliminal clustering pattern. Various clus- ponent l in LAB color space is fixed to filter the influence tering methods are constantly proposed and improved. This proposed algorithm is based on classical K-means cluster analysis. Because of the high efficiency of the * Correspondence: [email protected] Image Processing and Pattern Recognition Laboratory, Beijing Normal algorithm, it is widely used in the clustering of large-scale University, Beijing, China data [5]. At present, many algorithms are extended and © The Author(s). 2018 Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. Zheng et al. EURASIP Journal on Image and Video Processing (2018) 2018:68 Page 2 of 10 improved around this algorithm. Compared with the trad- segmentation can be carried out more quickly while the itional K-means method, the improved algorithm we pro- clarity of basic requirements is satisfied. posed in this paper will transform the image into the LAB color space before segmentation and set the luminance l 2.2.2 L*a*b* color space conversion to the fixed value to reduce the interference caused by the Because L*a*b* [6] is wide in color space, it not only background. In addition, for the selection of K value, contains all the color fields of RGB and CMYK but creatively put forward the number of connected domain also displays the colors that they cannot perform. The images meet requirements comparing with iterative vari- colors perceived by human eyes can be expressed by ables, and when the two are equal, the value of K is the the L*a*b* model. In addition, the beauty of the value of iterative variable. The improvement of the above L*a*b* color model is that it compensates for the part can greatly improve the accuracy of image segmenta- inequality of the color distribution of the RGB color tion and also optimize the optimization of algorithm model because the RGB model has too much transi- structure to a certain extent. tion color between blue and green. However, it lacks yellow and other colors in green to red. Therefore, 2 Method we choose to use L*a*b* when dealing with food 2.1 Overview images that need to retain as wide a color space as In this dissertation, the proposed method is divided into possible [7]. the following steps: image normalization, color space After a lot of experimental verification, we found conversion, adaptive K-means segmentation, and image that different food images will inevitably cause uneven morphology processing. Finally, the maximum con- background due to differences in conditions such as nected domain algorithm is used to match the original light and the color of the food itself, which will image. Our technology flowchart is shown in Fig. 1. seriously affect the segmentation results. Therefore, we take the L* component, the luminance component, in L*a*b* as a fixed value x. 2.2 Image preprocessing First of all, we need to realize the conversion of the Before the formal processing of the image, we will first L*a*b* color space and the RGB color space of the perform some necessary preprocessing on the image to image itself. Since RGB cannot be directly converted meet the requirements of the subsequent steps and into L*a*b*, it needs to be converted into XYZ and achieve faster and better segmentation. then converted into L*a*b*, i.e., RGB–XYZ–L*a*b*. Therefore, our conversion is divided into two steps: 2.2.1 Image normalization (1) RGB to XYZ. Since the size of the processed image is different, the Assume that r, g, b are three channels of pixels, image needs to be normalized firstly. The photos will be and the range of values is [0,255]. The conversion compressed to a certain extent, so that the subsequent formula is as follows: Fig. 1 Technology flowchart Zheng et al. EURASIP Journal on Image and Video Processing (2018) 2018:68 Page 3 of 10 Fig. 2 Comparison before and after treatment. a The original image. b Transferred to L*a*b* color space 8 2 3 > ¼ r 0:4124 0:3567 0:1805 > R gamma <> 255 M ¼ 4 0:2126 0:7152 0:0722 5 ¼ g G gamma ð1Þ 0:0193 0:1192 0:9505 > 255 > b : B ¼ gamma 255 The gamma function in the formula is used to perform nonlinear tone editing on the image in order to improve the image contrast and the gamma function is not fixed. (2) XYZ to L*a*b* 8 2:4 The following results are obtained by using the ob- <> x þ 0:055 if x > 0:04045 tained XYZ results to convert the three components gammaðÞ¼x 1:055 :> x L*A*B*: otherwise 12:92 . Ã ð2Þ L ¼ 116f Y −16 Y n . Ã a ¼ 500 f X −f Z 2 3 2 3 Xn Zn X R . 4 5 4 5 Ã Y ¼ M Â G ð3Þ b ¼ 200 f X −f Z ð4Þ Z B Xn Zn Where f is a calibration function similar to gamma, which is defined as follows. Where, M is a 3 × 3 matrix: Fig. 3 K-means segmentation results Fig. 4 Post-filled image Zheng et al. EURASIP Journal on Image and Video Processing (2018) 2018:68 Page 4 of 10 are obtained. K-means algorithm is a typical repre- sentative of the clustering method based on the prototype function. It takes the distance from the data point to the prototype as the objective function of optimization. The adjustment rules of iterative op- eration are obtained by the method of finding ex- treme values of functions. The K-means algorithm takes Euclidean distance as the similarity measure, which is to find the optimal classification of an ini- tial cluster center vector, so that the evaluation index is minimum. The error square sum criterion function is used as a clustering criterion function. Fig. 5 Restoring images after Canny operator edge extraction Although the algorithm of K-means is efficient, value of K should be given in advance, and the selection of K value is very difficult to estimate.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    10 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us