1 Introduction and Motivation

The most important and rapidly developing areas in the field of visualization and control of microscopic objects is development of automated computer vision systems. Computer analysis of microscopy cell images has many real-life applications in a wide range of areas including diagnosis of a disease, morphological cell analysis and statistics [1]. It plays an important role in biomedical research and bioinformatics. Microscopic analysis approach is particularly important in solving the following problems: malignant transformation of normal cells and cancer cell detection, morphological changes in cells, dynamic changes in the cells during therapeutic procedures [2].

For that reason, automatic counting of cell nuclei is a key block in systems for microscopic analysis of cell images. Since 1970s automated methods of histological analysis have been developed [1, 2]. Detection of cellular structures and cell counting are common tasks for many investigations.

Some researchers have applied thresholding for cell counting in the investigated images. It is a simple way for separating objects of interest from the background. Another approach is to segment images using different edge detection (LoG filter, Laplacian filtering, etc.). However, detection and segmentation of cell nuclei is a challenging task, since the cells have a complex and a nonuniform structure. Another feature of histological image is non-uniform illumination, which also applies limitations on the use of standard approaches.

In recent years many methods have been proposed for cell nuclei segmentation, separation and classification in histological analysis. More sophisticated approaches consist of several image processing stages. These methods are based on traditional image processing algorithms like adaptive contour model, watershed, morphological operations, k-means, Support vector machine, etc. [312].

Recent works suggest combining different approaches for increasing performance. Several excellent reviews about methods for nuclei detection, segmentation and classification can be found in [1, 2].

The main methods for cell nuclei segmentation, separation and classification are presented in Table 1.

Table 1. Short summary of state-of-the-art cell nuclei segmentation, separation and classification

In our research we study the problem of automatically counting of cell nuclei in histological images of their size and shape.

Depending on the quality of prepared medication and used optical equipment, microscopy image can be both grayscale and color. The large number of different objects in histological images is a serious disadvantage for analysis of this class of images. Unfortunately, cell nuclei analysis is challenging task because of the complexity of the natural objects (noisy images, background heterogeneity, variations in object characteristics). Most of the cell nuclei are part of histological structures with complex and irregular visual features [13]. Samples of microscopy images and their intensity histograms are presented in Fig. 1. Shape of histograms shows that the problem of automatic nuclei detection and segmentation in histological images is difficult by thresholding.

Fig. 1.
figure 1

H&E image samples (a), (c), (e) and their intensity histogram (b), (d), (f) respectively.

2 Methods and Materials

The investigated images are digital microscopy images stained with H&E (Hematoxylin & Eosin) from a publicly available data set [14, 15]. Authors [14, 15] used whole slide and tissue microarrays derived from tissue samples available through routine diagnostic. The histological slides were using the Zeiss Mirax Scan side scanner. The slide scanner was equipped with Zeiss Plan-Apochromat 20x (numerical aperture = 0.8) and an AVT Marlin F-146C Firewire \({1/2}''\) CCD camera with \(4.65\,\upmu \text {m} \times 4.65\,\upmu m\) pixel size. Combine with the 20x objective and 1x C-mount adapter the resulting image resolution is \(0.23\,\upmu \text {m} \times 0.23\,\upmu \text {m}\). All slides were scanned at 20x and performed at full resolution. The resulting images were converted to the Virtual Slide Format with actual image data encapsulated and saved as JPEG image files with 85 % JPEG quality. The image sizes vary from \(33280\times 29184\) pixels to \(70080\times 159000\) pixels, but the analyzed field of the images had a size of \(600\times 600\) pixels.

The final dataset contains 7931 cells from 36 color tissue images. The images of different organs (breast, kidney, gastric mucosa, connective tissue, small intestine, etc.) are found in data set. The nuclei center coordinates are used as ground truth data for proposed approach validation. All images were labeled by three pathologists, Fig. 2.

Fig. 2.
figure 2

An example of H&E image with labeled nuclei centers.

2.1 The Main Idea

The proposed approach for cell nuclei counting in histological image analysis consists of the following stages: 1. RGB color space regularization; 2. image intensity adjusting; 3. guided filtering; 4. thresholding; 5. morphological processing.

The preprocessing stage includes several steps. Original images contain a limited number of primary colors such as pink, purple and shades of blue. It is proposed to reduce the number of colors in the original image palette using Minimum Variance Quantization. Minimum variance quantization cuts the RGB color cube into smaller boxes (not necessarily cubical shape) of different sizes, depending on how the colors are distributed in the image. If the input image actually uses fewer colors than the number specified, the output colormap is also smaller, Fig. 3.

Fig. 3.
figure 3

(a) An input image, (b) the image after requantization. (Color figure online)

For the tested data set this procedure is almost visible to the human eye because of the limited number of colors in the difference between original images and same images after regularization is hardly visible (Fig. 3), but it is crucial for further image analysis stages.

After that we try to increases the contrast of the images by a contrast enhancement procedure.

The next step is using guided filter. The filter performs edge-preserving smoothing of images, using content of a second image, called a guidance image, to influence the filtering. The guidance image can be the original image itself, a another version of the original image, or a completely different image. Guided image filtering is a neighborhood operation, like other filtering operations, but takes into account pixel statistics in the corresponding spatial neighborhood of the guidance image when calculating the value of the output pixel [16].

Then we apply binarization by Sauvola local image thresholding [1719] for separation nuclei and background, see Fig. 4.

Fig. 4.
figure 4

Improvement in binarization by guided filtering: (a) input grayscale image, (b) thresholding without guided filtering; (c) input grayscale image after guided filtering; (d) thresholding after guided filtering.

We clean the obtained binary images by opening and closing with a small structure element. After that we count automatically the number of black blobs corresponding to the cell nuclei.

Opening and closing to the binary images we apply analysis help us to clean the binary images. They are both derived from the fundamental operations of erosion and dilation. Like those operators they are normally applied to binary images, although there are also gray level versions. The basic effect of an opening is somewhat like erosion in that it tends to remove some of the foreground (bright) pixels from the edges of regions of foreground pixels.

2.2 Nuclei Counting and Method Validation

We have tested implementations (in Matlab) of the proposed approach in 36 images from the data set described above.

The typical parameter values used in our experiments are shown in Table 2.

Table 2. Typical parameters values

Example of analysis results on H&E images is shown in Fig. 5.

Fig. 5.
figure 5

(a) An example of the original image and (b) its binary variant with the centers of cell nuclei labeled by experts.

The performance of calculation was calculated using TP (true positive), FN (false negative) and FP (false positive) events. The performance parameters precision and recall calculating using (1)–(2).

$$\begin{aligned} Precision=\frac{TP}{TP+FP} \end{aligned}$$
(1)
$$\begin{aligned} Recall=\frac{TP}{TP+FN} \end{aligned}$$
(2)

A measure that combines precision and recall is the harmonic mean of precision and recall, the traditional F-measure or balanced F-score (3):

$$\begin{aligned} F=2\cdot \frac{Precision\cdot Recall}{Precision + Recall} \end{aligned}$$
(3)

We compared the results with recent advances in this area [7, 9, 10], Table 3.

Table 3. Detection results of the proposed approach, Wienert’s, Al-Kofahi’s methods in precision and recall values

3 Discusion

Table 2 shows the best parameters for the tested image database. Developed approach can be adapted to different nuclei counting task. Its main advantage is automatically approach for cell nuclei counting. In future, it is necessary to automatization the process of the initial parametrs settings depending on images. Cell nuclei with small area were lost because we used the guided filter and mathematical morphology. But it allows us to get more accurate results for other cells. This is due to the fact that the improved thresholding results (disappear small areas that are not true cell nuclei). Future work will be focused on improving the segmentation stage and enlargement of the tested image data set. In contrast to the known algorithms, the proposed approach does not segment all of the nuclei in images.

The aim of the experiments was not to improve metrics Precision and Recall. We just calculated them with results of the similar research. In our method the value of F-measure is equal to 0.8743. It is bigger than F- measure of Al-Kofahi, but smaller than F- measure of Wienert results. There are a lot of small nucleus in the images, which have been marked by the experts. These nucleus difficult to correctly identify and count. In this way, we obtain decrease Precession accuracy. More subtle settings allow detecting the missing small nucleus, but this requires coordination with experts about nuclei features.

4 Conclusions

An automated cell nuclei detection and counting method based on the guided filter and morphological operations is proposed. Different to the existing algorithms, the proposed approach does not segment nuclei in images. It only detects the cell nuclei in a histological image and estimate the number of the detected nuclei. It avoids complicated algorithmic computations and provides good accuracy in the cell nuclei counting. The software prototype developed in our study may be considered as an automatic tool for a cell nuclei analysis.