COLOR SEGMENTATION OF HOMOGENEOUS AREAS ON COLPOSCOPICAL IMAGES

The article provides an analysis of image processing and color segmentation applied to the problem of selection of homogeneous regions in the parameters of the color model. Methods of image processing such as Gaussian filter, median filter, histogram equalization and mathematical morphology are considered. The segmentation algorithm with the parameters of color components is presented, followed by isolation of the resulting connected component of a binary segmentation mask. Analysis of methods performed on images colposcopic research.


Introduction
In Russia cervical cancer ranks third among cancers of a reproductive system [1]. Colposcopy is one of the methods for early diagnosis of cervical precancer [2]. The images obtained from this procedure are suitable for their analysis aimed at identification of pathological processes on the surface of the cervix. The aim of this study is the selection and implementation of methods for preprocessing image of cervical surface in order to eliminate their artifacts (e.g., glare light in cervical mucosa), and identify homogeneous areas showing changes in the structure of the surface investigated.

Research methods
The design team has realized a searching and processing algorithm for flaring areas (image areas with maximum light intensity). At the initial stage, the color model transits from the RGB to HSV (1). After that the flaring areas (where pixel values have up to 15% saturation and not lower than 77% brightness) are searched according to the set parameters of the color model. As a result, a binary mask, comprising a glare area, was constructed ( Figure 1). Thе image contains many torn areas and areas with a low specific weight. To eliminate the problem, pre-processing blurring of an image using Gaussian filter can be applied.
where R,G,B -red, green, blue components of a colour model RGB, H,S,V -components of a colour hue, saturation and brightness of the HSV color model, ; MAX,MIN -RGB. maximum and minimum value of RGB color components.
Gaussian filter-is one of the most commonly used filter for convolution matrix [3]. The elements of its nucleus are formed by a Gaussian function (2).
Compression is described by function (3). Blurring depends on the size of the compression kernel and value σ (radius). For the correct formation of the kernel three sigma rule must be used.
for highlighting glare areas.
The described method can be used not only for highlighting glare areas but also for identification of areas containing potential pathology. For example, the areas affected by erosion will be red. After treatment of the epithelium with acetic acid (or iodine), it will not be colored in orange; it will become white. The areas suitable for analysis must undergo further processing of the binary mask obtained using color segmentation. The set of mathematical morphology operations will remove unnecessary small elements and holes, make the outlines smoother, identify shapes of the objects. The paper uses the following operations of mathematical morphology using structural elements: 1. Expansion. If the central element and the pixel of the input image are shown in color, the output image pixel and the area around it are colored. It is possible to enlarge an object on a binary mask. 2. Erosion. If all elements of a structural element match (also shaded) pixel and its neighborhood, the output image pixel is colored (the current pixel is changing). It is possible to make objects on a binary mask smaller or exclude them. 3. Disclosure. Consistent application of erosion and expansion. eliminates objects which are smaller than the structural element without making the objects smaller. 4. Closure. Consistent application of erosion and expansion makes the objects smoother and combines connected components in the surrounding area. For visualization of the image segmentation the following sequence of operations is used: 1. Application of erosion with a structural element ( Figure 2). 2. Subtraction of the result obtained from the original binary mask. For recognizing of connected components a modified two-pass algorithm for a serial scanning of eight-bin elements is used. In comparison with a standard method of serial scanning in this approach, each row of the matrix is scanned in two passes -forward and backward ones. The mask of the forward and backward passes is shown in Figure 3, where e -the currently analyzed pixel, and a, b, c, d -the neighboring pixels. In the direct iteration (forward pass) a local table of equivalences is filled and presketching of the areas is done (4), and in the reverse iteration (backward pass) equivalent values are replaced in accordance with the table of equivalences (5).  This modification reduces the number of scan passes, which greatly increases the processing speed. The result of the operation is a mask with numbered connected areas, allowing to analyze them using pattern recognition algorithms. For improvement of image analysis equalization or linearization of the histogram can be used. It can normalize brightness levels. The median filter can remove some noise. The images of the cervical mucosa usually have brightness differences. Histogram equalization of these images allows to make areas more contrasting, different from main color of the image [4]. This step allows to define the boundaries of the areas more clearly, which greatly improves the quality of segmentation. During screening of the histogram according to the parameters of the RGB model, the components tend to reduce the intensity of their color. Therefore, in order not to change color temperature, it is possible to carry out a histogram equalization according to the intensity parameter of HSV color model. The example of histogram equalization is shown in Figure 3.
Firgure 3. Histogram equalization on the light-exposed image in RGB color space, and according to S parameter in HSV color space.
The median filter is based on the idea of averaging of pixel values byreplacing them with the median pixel values from the surrounding area [5]. The power of averaging will depend on the size of the neighborhood. The example of removal of artifacts is shown in Figure 4. It is proposed to use a randomized algorithm for matching the structural editing of images PatchMatch (described in the study) for visual better perception of images by doctors [6]. The algorithm applied to the results (Figure 1), is shown in Figure 5. It should be noted that the algorithm can not predict accurate areas, which tend to be overexposed.  . Bridging of a binary mask with an element (diameter 9) removed the elements with a low specific gravity and connected potentially simply-connected areas. After that simplyconnected areas are searched using a modified two-pass algorithm of sequential scanning. Identification of boundaries of mathematical morphology on the binary mask allowed to mark the areas by applying a binary mask on the original image.

Conclusion
The described methods have been implemented in computer applications C #. The results of the study, including the analysis of the applicability and implementation of the methods described will be applied in specialized software for the analysis of colposcopic images. In particular, they will be implemented in analytical algorithms and used for improving the quality of colposcopic images and their segmentation. Such algorithms will allow to carry out an automated diagnosis of the surface of the cervix on the basis of its image.