Research on Cell Counting Method Based on Flood Fill Algorithm

Cell counting has a wide range of applications in cytology research and clinical practice. Cell counts are widely used in the early diagnosis and treatment of serious diseases and the screening of effective drugs in the later stage. The method of studying cell counts is of great significance. This paper proposes a method for cell counting based on the highlight area of the cell center as a live cell marker. This method uses algorithms bilateral filtering to smooth noise in the original image; after adaptive threshold segmentation, an algorithm based on flood filling is used. Accurate segmentation of the highlighted area in the center of the cell; finally, counting is achieved through the connected domain labeling algorithm. The experimental results show that the accuracy of the cell counting method proposed in this paper is above 98%, which verifies the feasibility and practicability of the method proposed in this paper.


Introduction
In the functional research of biology or clinical pathology research, the application of cell counting is becoming more and more extensive. For example, a complete cell count can help determine the conditions under which tumor cells can grow. In tumor cell research, an automatic tumor cell identification and counting system is urgently needed to assist researchers in efficient research. The current cell count is mainly divided into manual counting and cell counter counting. Manual counting is time-consuming and laborious [1], low work efficiency, and strong subjectivity. The cell counter is gradually replacing traditional manual counting with its advantages of convenient operation and fast running speed. The working principle of the cell counting instrument is mainly divided into Coulter principle [2], flow cytometry [3] and image method.
The Kurt principle is also known as the electrical impedance method. Its principle is to generate a pulse signal based on the cell's own impedance. The cell count is achieved through the proportional relationship between the size and number of pulse signals and the size and number of cells. Counting instruments that use the Coulter principle need to clean their built-in fluid system regularly to prevent clogging of the pipeline, and such instruments cannot observe the shape of the cells. The main principle of flow counting is that when a single cell labeled with a specific fluorescent reagent passes through the detection area irradiated by the laser with the sheath fluid, the light beam is refracted, diffracted and scattered, and the scattered light detector generates a pulsed light signal after receiving it. Converted into electrical signals, the pulse size is proportional to the size of the illuminated cells, and the number of pulses represents the number of illuminated cells. The flow cytometer used for cell counting requires specific fluorescent reagents and corresponding excitation light, and the cost is high, With the development of image processing technology, there are more and more applications for cell counting using image methods. The high-definition camera collects clear cell images, and realizes cell counting through corresponding image processing methods. This method can not only count cells accurately, but also study other characteristics of specific cells. For example, Nguyen used the maximum between-class variance method (OTSU method) to segment the foreground (cell) and background of the red blood cell blood smear image, and used a distance transformation algorithm based on Euclidean distance to detect the cell center [4] . So as to achieve the separation of overlapping blood cells. Tulsani converted the cell image to the YCbCr space, extracted white blood cells and platelets in the Cb channel using the threshold segmentation method, and then obtained the red blood cell image area, and then used the watershed segmentation algorithm to complete the segmentation of overlapping red blood cells [5]. Gamarra proposed a new fluorescence microscopy image cell segmentation method [6], which combines the MC-watershed algorithm and the SM-watershed algorithm. The MC-watershed algorithm separates cells from the background, and the SM-watershed algorithm Separate the aggregated cells. This method produces an appropriate compromise between over-segmentation and under-segmentation, and provides better performance in cell segmentation tasks. Falko proposed the use of a convolutional neural network structure and regarded the cell counting problem as a regression task [7], thus treating the image cell counting as an annotation for supervised training, and compared the specific deep residual network structure xResNet with migration learning. In combination (using a pre-trained model), the performance of the model is further improved.
For cell counting based on image processing methods, this research group designed a microscopic cell image acquisition device. This article mainly describes the process of image method to achieve cell counting. In the process of cell image acquisition, the cytoplasm of living cells in the cell suspension is permeable, and the brightness of the cell center area is higher than the cell edge and background area during imaging. According to this feature, the algorithm based on flood filling [8] is used to obtain the brightness area of the center as the cell marker, so as to realize the cell count.

Materials and Methods
The image has problems such as uneven illumination, cell adhesion, noise, etc. Before counting the cell image, a series of preprocessing operations are required on the image, and then the cell image segmentation and counting are performed.

Filtering
In the image acquisition process, it is inevitable that various noises will be generated. Among them, the universality of Gaussian noise in the image has become a problem that must be solved in image processing. Gaussian filtering [9] is a low-pass linear smoothing filter that determines the weight through normal distribution. The method to define Gaussian blur (GB) to filter the image is: Among them G x is the two-dimensional Gaussian kernel: The Gaussian low-pass filter calculates the weighted average of the pixel values in the neighborhood, and its weight decreases as pthe spatial distance to the center decreases. This distance is G ‖p q‖ defined by the parameter σ that defines the expansion of the neighborhood. As a result, the edges of the image are blurred, which is not conducive to the later measurement of cell diameter.
Although Gaussian filtering has a smoothing effect on the image, it cannot preserve the contours of cell edges. Therefore, a bilateral filter [10] is used, which is a non-linear filter that can effectively filter out background noise and maintain the edge of the target area. The bilateral filter, denoted as BF . , is defined as: Among them W is the standardization coefficient: The bilateral filter is controlled by two parameters: σ and σ . As the range parameter σ increases, the bilateral filter becomes closer to Gaussian blur, because the range Gaussian is flatter, that is, the intensity range covered by the image is almost a constant. Increasing spatial parameters σ can smooth larger features. It can be seen from Figure 2 that although the Gaussian filtering process can filter out the noise in the image, it makes the image blurred, while the bilateral filtering process can more effectively filter out the noise in the image and make the cell edges appear clearer.

Adaptive threshold segmentation
Threshold segmentation is a classic method in image segmentation, such as the bimodal method and the OTSU algorithm, but both of these algorithms belong to the global threshold method. The method of global threshold segmentation [11] for images with uneven illumination will appear pale. Adaptive threshold segmentation [12] makes up for the shortcomings. The algorithm does not calculate the threshold of the global image, but calculates the local threshold according to the brightness distribution of different areas of the image. Therefore, for different areas of the image, different areas can be calculated adaptively. The threshold is therefore called the adaptive threshold method. It can be seen from Figure 3 that the global threshold segmentation algorithm is obviously insufficient in processing images with uneven illumination, and cannot segment all target cells well. Adaptive threshold segmentation perfectly solves the shortcomings of global threshold segmentation, and plays an important role in processing unevenly illuminated images. When adaptive threshold segmentation extracts all target cells, some noise points are also generated. However, this does not affect the subsequent image processing.

flood fill algorithm
The flood fill algorithm is named because its idea is similar to the flood spread from one area to all areas that can be reached. It is a method of filling connected areas with specific colors, and achieving different filling effects by setting the upper and lower limits of connectable pixels and the connection method. This function is often used to mark or separate a part of the image for processing and analysis. This article uses this algorithm to extract the central part of the cell.
The implementation principle of the flood fill algorithm is basically to start from a point (initial point), traverse nearby pixels, and fill them with new colors until all pixels in the enclosed area are filled with new colors. The spreading condition is that the similarity between the position and the value of this position meets the requirements. There are four-neighbor pixel filling method and eight-neighbor pixel filling method for the realization of flood filling. In order to reduce the calculation, the 4-neighbor pixel filling method is adopted in this paper. The purpose of the segmentation algorithm in this paper is to find the highlighted area in the center of the cell surrounded by the edge of the cell. The algorithm processes Figure a to find the hole surrounded by the black circle, that is, the highlighted area in the center of the cell. The pixel inversion of image b is used to mark the connected domain of the white area in the binary image [13]. The last step is to use the connected domain labeling algorithm to mark the highlighted area of the cell center in the original image, and count the connected domains. The counting result is the total number of living cells in the cell image.

Result and analysis
In this paper, precision rate (P), recall rate (R), the comprehensive evaluation index (F-Measure), etc. are used as evaluation indexes of counting results. 6 means cells that can be identified by the cell counting algorithm in this article but not recognized by experts. F1 combines the results of P and R. When F1 is higher, the test method is more effective.
This article lists ten groups of different tumor cell images to count the cells and calculate their precision rate (P), recall rate (R) and the comprehensive evaluation index (F1).  According to the chart data, it can be seen that the accuracy and F value of the counting result are both above 98%. For dense cell images, the algorithm in this paper can still count efficiently, and the counting accuracy rate is high.

Conclusions
This paper proposes a cell counting method that has high counting accuracy and does not require training and learning. It is implemented based on image processing methods. The cell counting method based on image processing adopts the latest image processing technology. It has the advantages of high counting efficiency, high accuracy, good repeatability, and intuitive results. It will definitely become the mainstream cell counting method. Therefore, the research on cell counters based on cell image processing has great practical significance. According to the characteristics of cell image imaging under the camera, image processing techniques such as bilateral filtering, adaptive threshold segmentation, and flood fill algorithm are used to extract the central brightness area of the cell as an The disadvantage is that during the production of the cell counter, the cells in the cell suspension often have cell stratification, which makes the camera unable to capture a clear image of the underlying cells at the same height, which leads to the missed count of the number of cells. This is the next research direction, and it is hoped that this problem can be improved through the automatic focus [14] system and image fusion technology.