APP下载

Research on Medical Image Segmentation Based on Morphology

2019-12-26YangYuMaZhiwenLiuJuan

中阿科技论坛(中英文) 2019年4期

Yang Yu’e ,Ma Zhiwen ,Liu Juan

(1.Anesthesia Room,Gansu Provincial Maternal and Child Health Care Center,Gansu,Lanzhou 730050;2.Xinjiang Uygur Autonomous Region People’s Hospital,Urumchi,Xinjiang 830001)

Abstract:Medical cell image segmentation and enhancement algorithm is an important part of medical cell image analysis.Firstly,enhance,smooth and denoise the image,then use the segmentation algorithm to segment the cell image.In this paper,spatial domain method is applied to enhance the information of medical cell images,and images with enhanced cell characteristics are obtained through Gaussian smoothing filter and noise reduction.In the steps of image segmentation,the watershed algorithm based on morphology and gradient calculation was used to segment the medical cell image target and obtain the edge of the medical cell target.Through experiments and comparison with Canny operator,the validity of the proposed algorithm is verified.

Key words:medical cell image;image segmentation;Canny operator;watershed algorithm

I.Introduction

Automatic segmentation used on medical cell images is often a difficult problem to solve because of the large amount of variability (such as different microscopes,staining,cell type,cell density)and the complexity of the data.At present,most cell segmentation methods are based on threshold segmentation,feature detection,morphological filtering,regional growth and deformable model fitting[1].

Threshold segmentation is one of the earliest and most important segmentation methods.The basic idea of threshold segmentation is to assume that all cells have significant,consistent and significantly different gray intensity from the background.In this case,fixed threshold can be used for global or local cell segmentation.However,this is often not the case in reality.In complex cases,using segmentation with a single threshold will get very poor results.Therefore,threshold segmentation is often used as the first step of cell segmentation[2].Feature detection is cell segmentation based on features derived from intensity of gray value,which can be easily detected by linear image filtering.In many cases,a first-order differential filter (such as Sobel operator)or a second-order differential filter(such as Laplacian operator)is often used.Similar to threshold segmentation,a single filter will not produce a clear cell contour,which provides useful information for subsequent processing[3][4].The basic principle of region growth algorithm is to divide the image to be processed into several regions through threshold set or human-computer interaction,and then set growing points in different regions.Compared with the adjacent pixel points,if the attributes of this growth point and the adjacent pixel points are similar,the growth point will continue to grow outwards and finally grow to the adjacent pixel points without similar attributes.In this way,the growth point will stop and the generated area is an area with similar properties[5].In addition to these basic methods,there are many new efficient segmentation methods iterated out.For example,the DPM (Deformable Parts Model)algorithm put forward by Felzenszwalb in 2008,Phase Stretch Transform (PST)algorithm put forward by UCLA JalaliLab in 2015 and segmentation algorithm based on neural network with the rise of machine learning in recent years[6].

In this paper,the frequency domain method is proposed to enhance the information of medical cell images,effectively sharpen the target edges through high-pass filtering,and effectively smooth the whole image through low-pass filtering.In the image segmentation stage,the segmentation algorithm based on morphological gradient calculation was used to segment the medical cell target.Through detailed experiments and comparison with Canny operator,the validity of the proposed algorithm was verified.

II.Medical Cell Image Preprocessing

In the process of image imaging,there will be a lot of interference factors,such as observing the influence of the instrument and light,whether the dyeing is even,and the influence of the signal transmitted to the computer,which will lead to uncontrollable situation.In order to eliminate these negative effects as far as possible or even completely,the image should be preprocessed first to ensure the normal follow-up work.The main purpose of image preprocessing is to eliminate irrelevant information in the image and retain core information in the image,and image enhancement and noise reduction smoothing processing is needed[7].

(i)Image Enhancement

In the process of image transmission,some uncontrollable factors cause the parts of the image that are interested to be blurred by different degrees.For example,the resolution of the sensor is not high enough,and the cell image taken by the sensor will be blurred at the edges after magnification,or because the light is not enough,the overall cell image is dark,and the contrast between the cell and the background is too low to be easily segmented.The function of image enhancement is to highlight the target area(foreground part)and suppress the irrelevant area,so that the image information is richer and the visual effect is better,which is convenient for the subsequent processing operation.In the actual situation,the quality of each medical cell image is uneven,and whether or not to enhance the cell image and which method is selected to use requires the operator's own experience and judgment,which is highly subjective.Therefore,whether the processing effect is good or bad will be judged differently depending on the operator's experience.This paper mainly applies the spatial domain gray value image histogram equalization method to enhance the image.

The basic idea of histogram equalization is to evenly transform the gray value concentrated in a certain area of the original image to the whole gray value variation range to improve the image contrast.For example,when the gray value of foreground and background is similar (both are very bright or very dark),it is difficult to divide the cell part.At this time,the use of histogram equalization can greatly improve the separation degree between the cell and the background,providing a good original image for segmentation.It uses statistical method to calculate the probability of each gray value appearing in the whole image,and calculates the value after equalization with the appropriate weight.In short,take pixels from small to large,calculate the probability and cumulative probability of each pixel,and the value of multiplying the respective gray value by the cumulative probability is the transformed gray value.Set a grayscale imagex,niis the grayscale value,i is the number of occurrences,the value range is 0 to 255,and the probability of grayscale value i can be got:

L is the gray number 256,and n is the number of pixels in the image,Pi(i)is the histogram of gray value I,so that it can be normalized.

Cumulative distribution functionis cumulative normalized histogram.

A linear transformationy=T(x)is performed on each original gray value:

The constant K can be transformed by the property of the inverse distribution function:

Tconversion will map the value to 0..1 domain,in order to make the value back to 0..255 domain,it is needed another transformation:

The equalization processing result of gray value image shown in figure 4 is obtained.

Figure 1 the Original Drawing of Cell

Figure 2 Result of Gray Processing

Figure 3 Cell Histogram

Figure 4 Equalization Result

Figure 5 Equalization of Cells Histogram

Neighborhood operations,also known as spatial filtering,are two-dimensional matrices that perform linear or nonlinear computations of the spatial domain.Linear operations are often designed on the basis of Fourier transforms,and non-linear operations often use custom filters to operate directly on spatial domain pixels.In the Fourier transform,pixel information below a certain gray value is completely retained,while pixels above this threshold are weakened or eliminated.This operation is often used to remove minor details to make the overall requirements more apparent.

(ii)Image Denoising

Noise may be generated during image imaging,transmission and processing.Noise is one of the main interferences in image processing.These noises can sometimes significantly degrade the quality of the cell image,blurring details or edges of cells.In order to retain and highlight the areas and details we are interested in as much as possible,the original image containing noise must be de-noised,which is conducive to the analysis and research of subsequent images.

Gaussian filtering uses Gaussian distribution to calculate the transformation of each pixel in the image.Two-dimensional space is defined as follows:

Shown through graph,it's a Gaussian concentric circle.Each center pixel is calculated by neighboring values.Convolution operation is performed with the set convolution kernel and the pixel region matrix of the same size.The matrix must be odd,so that the matrix has a center.For example,the matrix of 3×3 has a center with a radius of 1,and the weight of the center value is the highest.The farther away from the center,the lower the weight of the value.In this way,the value of each surrounding pixel is utilized,and the influence on the final result is different according to the different importance,so as to preserve the importance of the center value as much as possible.In this way,the edge effect is retained more effectively than other equalized fuzzy filters.In short,the square size of the matrix is the same,the values inside it conform to the Gaussian distribution,with the maximum center value,and then the values of the other values decrease as the radius from the center value increases,each value is calculated by the weighted average.

Figure 6 the Original Drawing of Cell

Figure 7 Two-Dimensional Gaussian Distribution

Figure 8 Results of Original Image after Gaussian Filtering

Figure 9 Add Gaussian Noise

Figure 10 Gaussian Filter Results after Adding Gaussian Noise

III.Segmentation of Cell Images Based on Morphological Watershed Algorithm

Watershed image segmentation algorithm is to determine the location of watershed to conduct image segmentation.Generally,considering that the gray scale of pixels in each region is relatively close,and the gray scale difference between pixels in adjacent regions is relatively large,the gradient map of an image can be calculated first,and then the watershed of the gradient map can be found.In the gradient map,the small gradient value corresponds to the inside of the region,while the large gradient value corresponds to the edges of the region.The watershed algorithm looks for the position of the pixel with the large gradient value,that is,the boundary position.

The target segmentation area watershed algorithms deal with is generally the cell and background junction,or between the cell boundary.The boundary region is obtained by subtracting the cell region from the non-background region[8].

The method of using expansion operations in mathematical morphology to iteratively compute watershed is described as follows:

(1)Firstly,set a segmentation image f(x,y)and a gradient image g(x,y),and the watershed was calculated on the gradient image.

Then use the M1,M2,...,Mn to represent the pixel position of each local minimum value of the image,C(Mi)is the set of pixel coordinates in the corresponding region of Mi,and n represents the current gradient threshold.

T[n]is denoted as the pixel set of(u,v),and g(u,v)<n,that is

The gradient threshold is increased from the lowest integer of the image gradient range.When the gradient threshold is n,the set of pixels in the plane g(x,y)<n is T[n].

The coordinate set C(Mi)of the region where Mi meets the condition is regarded as a binary image:

That is,in the C(Mi)region and T[n]region at the same time,Cn(Mi)=1,otherwise 0.

Then use C[M]to represent the set of all pixels in the image that satisfy the gradient value less than n when the gradient threshold is n:C[n]=∪Cn(Mi)i<n,C[Max +1]is the union of all regions,and max is the maximum value of the image gray scale range.

(2)Initialize C[min+1]=t[min+1]and iterate gradually.In the step n,establish C[n-1-1],and consider getting C[n]from C[n-1].

Let S represent the set of connected components in T[n],and when each connected component S ∈S[n],there are three situations:

a.S∩C[n-1]is an empty set-C[n]=s+C[n-1]

b.S∩C[n-1]contains a connected component of C[n-1]-C[n]=s+C[n-1]

c.S∩C[n-1]contains more than one component of C[n-1]-a watershed is needed to be established in s to expand s∩C[n-1].

Because in the watershed algorithm,the background region marked as 0 will be regarded as the unknown region.So use other integer tags to avoid the background area being treated as unknown and the uncertain area being marked as 0.After the tag is created and marked,the watershed algorithm is finally used to process it.The border area is labeled as-1.

According to the idea of watershed algorithm,all edge detection operators adopt the gradient idea,that is,the calculation of a certain edge point is calculated according to the gray value of the surrounding points.Firstly,image graying and binary processing were carried out,followed by morphological operation,then conduct distance transformation,and finally watershed change was conducted to obtain the results.The segmentation results of the watershed algorithm are obtained from the image gray value binarization and morphological expansion operation.The specific experimental results are shown in figure 15 to figure 18.

It can be seen from the results that the segmentation results of the watershed algorithm are good,with smooth,clear and continuous edges,which can produce a good segmentation effect for most cells.However,for the case of large changes in the internal light and dark of cells,sometimes brighter internal regions will be segmented.For some closely connected cells,they can also do a good job of processing their boundaries.

IV.Algorithm Analysis and Comparison

In order to further verify the validity of the proposed algorithm,Canny operator is used to segment medical cell images.Canny operator has good results in detecting weak boundary of image,the specific processing process is as follows:firstly,the Gaussian filter of 3×3 is used for noise reduction,then grayscale the image,and use Canny algorithm to conduct edge detection on the cell image,then contour marking is carried out on the edge detection image,and finally obtain the segmentation effect picture.Figure 11 is the original image,figure 12 is the image boundary detected by Canny operator,and figure 13 and 14 are the results of segmenting cell images with different pixel widths respectively.

Figure 11 the Original Drawing of Cell

Figure 12 Effect of Boundary Detected by Canny

Figure 13 Results of Canny Segmentation with the Width 1 for Edge Pixel

Figure 14 Results of Canny Segmentation with the Width 2 for Edge Pixel

Figure 15 Watershed Algorithm Gray Value Binarization Image

Figure 16 Watershed Algorithm Morphological Calculation

Figure 17 Threshold Operation after Watershed Morphology Calculating

Figure 18 Watershed Algorithm Final Segmentation Results

By comparing the results of the two segmentation methods in figure 14 and figure 18,it can be seen that each cell can be identified by the two segmentation methods,and there is no cell missing segmentation.However,the segmentation method based on Canny operator doesn’t have smooth edges and have more the internal and external lines,whereas the number of lines obtained by the watershed algorithm is relatively small,and the edge lines are smooth and clear;although there are cases of internal lines being drawn,the number of lines is relatively small and it has a good effect on the processing of detailed target boundary.It can be seen that the algorithm proposed in this paper has good segmentation results with smooth,clear and continuous edges.In particular,the target processing of cell images is more refined.At the same time,when the internal light and dark of cells change a lot,the brighter internal areas can also be segmented.The segmentation of closely connected cells needs to be further studied and improved.

V.Conclusion

In this paper,the present medical image segmentation algorithms are studied from the aspects of image preprocessing,noise reduction and application of segmentation algorithms.It is proposed to apply the spatial domain method in the image preprocessing,smooth the medical cell image and further reduce the noise of the whole image to highlight the target characteristics.Through the study of watershed image segmentation algorithm based on morphology,the target image is segmented based on the previous image processing,and good results are obtained.Meanwhile,in order to illustrate the effectiveness of the proposed algorithm in this paper,the results of Canny operator segmented cell image are compared with the proposed algorithm.From the result observation,the algorithm in this paper combines the features of morphological images and gradient features,and has better adaptability to the detection target,more accurate target boundary,less redundant information,smooth and continuous segmentation edge,and better adaptability to noise,which fully demonstrates that the watershed algorithm is effective in segmentation cell target images.