Segmentation and counting of blood cells are considered as an important step that helps to extract features to diagnose some specific diseases like malaria or leukemia. The manual counting of white blood cells (WBCs) and red blood cells (RBCs) in microscopic images is an extremely tedious, time consuming, and inaccurate process. Automatic analysis will allow hematologist experts to perform faster and more accurately. The proposed method uses an iterative structured circle detection algorithm for the segmentation and counting of WBCs and RBCs.
The separation of WBCs from RBCs was achieved by thresholding, and specific preprocessing steps were developed for each cell type. Counting was performed for each image using the proposed method based on modified circle detection, which automatically counted the cells. Several modifications were made to the basic (RCD) algorithm to solve the initialization problem, detecting irregular circles (cells), selecting the optimal circle from the candidate circles, determining the number of iterations in a fully dynamic way to enhance algorithm detection, and running time. The validation method used to determine segmentation accuracy was a quantitative analysis that included Precision, Recall, and
The analysis of microscopy images is extremely important in both the medical and the computer science fields. Many research problems are related to the analysis of microscopy images, such as complete blood count (CBC) tests [
CBC tests and the analysis of blood smear images help to evaluate, diagnose, and monitor various health conditions, such as anemia, leukemia, infections, and allergic conditions [
Malaria and
Many researchers have investigated blood cell segmentation and counting. Some researchers [
Nguyen et al. [
Rhodes and Bai [
Since blood cells are approximately circular shape, circle detection algorithms can still handle the challenge of blood cells detection. Hough Transform is considered as one of the most known algorithms for line and circle detection. It was developed by Richard Duda and Peter Hart in 1972 [
Chiu et al. [
Chen and Chung [
Since the Hough Transform presented a good performance in different fields, many researchers [
Mahmood and Mansor [
With similar inspiration to [
Finally, Cuevas et al. [
The proposed method was developed to analyze microscopic images of blood smears by segmenting and counting both WBCs and RBCs. The segmentation is based on thresholding and morphological operations, and then counting is based on the circularity feature of the blood cells extracted using an iterative structured circle detection algorithm.
A new technique for binary images based on the fundamentals of RCD has been proposed and used for counting RBCs and WBCs. Therefore, the original image is separated into two images; the first image contains RBCs only and the second image contains WBCs; this step has been done using thresholding. We study the histogram for 20 sample gray scale images, and we find out the best thresholding values to extract WBCs and RBCs; values were 64 and 140, respectively. After cells separation, each image is preprocessed using morphology operators to obtain the edge image using Canny operator. Then, an iterative structured circle detection algorithm is used to count cells in each image. Figure
General methodology for the proposed method.
The proposed method for cell segmentation works with edge images. Microscopy images of blood smears are colored images, and several steps are required to prepare the image before extraction of the edge image. In our proposed method, the cells were separated by type and distinct preprocessing steps were developed for WBCs and RBCs separately.
Figure
Preprocessing steps for WBCs.
(a) Original blood image, (b) gray image, (c) binary image using thresholding, and (d) complement image.
This image eroded to reduce the number of overlapping cells, as shown in Figure
(a) Eroded image, (b) image after filling holes, (c) edge detection using a Canny at high magnification, and (d) image after removing the noise at high magnification.
In this stage, preprocessing was performed on the red blood cells after removing the white blood cells from the image. Figure
Preprocessing steps for RBCs.
Then, image was converted to binary using thresholding value of (140), to visualize all of the red and white blood cells in the image, as shown in Figure
(a) Binary image using thresholding, (b) RBCs after removing the WBC’s by subtracting the two images, and (c) image after filling holes.
When the image was converted to binary and the white blood cells were removed, undesired holes were created. These holes disturb the solidness of the object. Therefore, morphological operators are used to fill the holes, as shown in Figure
A morphological step using an erosion operator is used to reduce the overlap between cells, as shown in Figure
(a) The eroded image, (b) image after edge detection using thresholding, and (c) after removing extra unconnected pixels.
The basic idea for the proposed method was derived from the RCD [
Proposed method workflow.
Regarding to this initialization problem, as we highlighted earlier that selecting four pixels globally (from the whole image) can reduce the probability of finding true circle, time consuming, and needs of a high number of iterations to find all true circles. This can be easily illustrated as in Figure
(a) Initialization problem in basic RCD in real image, and (b) partition from an image.
In each partition image, our proposed method randomly selects up to four edge pixels and checks the existence of a circle using (
If the result is zero, the threeedge pixels are collinear and cannot form a circle; they are returned to the edges array for the chosen partition, and four new subsequent pixels are selected from the same partition.
If the pixels are not collinear, they are able to form a circle. Four candidate circles, C_{123}, C_{124}, C_{134}, and C_{234}, can be formed using the four edge pixels (v1, v2, v3, and v4), as shown in Figure
Four candidate circles formed using four edge pixels.
In basic RCD algorithm, circle can be formed with three prior pixels; the fourth pixel is used to obtain four candidate circles at a time for each iteration, which is better than forming one candidate circle for each iteration. However, in our proposed method, one of the candidate circles, C_{123}, C_{124}, C_{134}, and C_{234}, is selected to be possible circle. This based on the candidate with the highest probability of being a possible circle. This can be achieved by checking the number of edge pixels located on the boundary of each candidate circle. We assumed that candidate circle with the maximum number of edge pixels on its boundary is considered as a possible circle. The following calculates the distance between each edge pixel
After checking all of the edge pixels in the partition and selecting the possible circle, the number of edge pixels located on its boundary is determined. If this number is greater than the value obtained from
If the number of edge pixels on the boundary of the possible circle is less than the threshold value
By adding the 8neighbor connected component step, the algorithm is guaranteed to randomly select edge pixels from every part of the image, check the circle possibilities for all image edge pixels, and locate more true circles, which improves the performance of the method, especially for large images with a high number of pixels.
Another drawback of basic RCD algorithm, it chooses four random edge pixels from the entire or global image that may cause chosen pixels from different actual shapes as depicted in Figure
(a) Wrong circle detection in basic RCD algorithm and (b) some basic RCD thresholding values.
Taking into account the above problems, we introduce partition based on 8nieghbor connected components in our proposed method. We restrict up to four random selected pixels from a particular partition. Next, we also check the number of edge pixels located on the possible circle boundary within that particular partition. Having known these pieces of information, it guarantees (1) better improvement performance and (2) higher probability of finding all existed true circles in that source image and reduces truenegative circles.
(a) The irregular circle detection method and (b) the detection of gray pixels of the irregular cell.
The red pixels are not included in the boundary of candidate circle. By partitioning the image based on connected components, we increase the distance between the two circles. This ensures that the detection edges on the boundary of the possible circle will be correct without using edges from other shapes, as observed in Figure
For example, assume we have a partition image, as shown Figure
Example of (a) partition image, (b) first, (c) second (d), and third random pixel distribution cases demonstrating unacceptable circles and (e) the accepted case of random pixel distribution.
According to the information above, the number of iterations can be determined as detailed below. Suppose random pixels were selected on the first iteration, such as in Figure
Figure
Some cases for unacceptable circles for the case shown in Figure
Because the proposed method requires a certain distance between random edge pixels on the same circle, the number of iterations was increased slightly to tolerate the proposed method conditions and ensure that all possibilities are included. The final expression for the number of iterations is as follows:
For the previous example, the proposed method requires
Divide the entire binary image to a small partitions based on 8neighbor connected components. Each partition is denoted by
The algorithm loops from
If
Determine the four candidate circles from the four edge pixels such that the distance between any two of the three pixels that forms the circle is greater than
Proposed method parameters.
For each candidate circle, the number of pixels on the boundary is calculated using (
If the number of pixels on the boundary of the possible circle is greater than
The proposed method has a few thresholding values (
Specifying
As conclusion, several improvements were made to the basic RCD algorithm, including the initialization step, solved by addition of 8neighbor connected component step. Which divide the image into smaller partitions and the ability to select random edge pixels locally from the smaller parts instead of choosing random edge pixels globally from the entire image. This increased the probability of locating more circles. Not all blood cells have a regular circular shape. By increasing the thickness of the circle perimeter, the proposed method is also able to detect irregular cells. Partitioning the image and specifying the cell radius in the proposed model improved the detection of overlapping cells. Finally, we determined a relationship between the cell radius and the number of edge pixels in the partitioned image to control the number of iterations.
The dataset used in this paper consisted of 100 actual microscopy images of blood samples. The images captured with an optical laboratory microscope coupled with a Canon Power Shot G5 camera. All of the images are in JPG format with 24bit color depth and a resolution of 2592 × 1944 pixels. The images were taken at different microscope magnifications ranging from 300 to 500x [
The ground truth was determined by an expert and used to validate our proposed method results.
The results from the proposed method were quantitatively analyzed based on the ground truth. Precision, Recall, and
We divided the dataset into 10 sets. For each set, we determined the average true positive value (TP), which is when the agreement between the expert and the proposed method for the detected cells. The false negative (FN), which is when the proposed method was unable to detect the cell but the expert detected a cell, and the false positive (FP), which is when the proposed method detected a cell but the expert did not. Then, we calculated the Precision (PR), Recall (RC), and
Summary of results for WBCs.
Set  Manual count  Proposed method count  TP  FN  FP  PR  RC  FM 

1  117  118  116  1  2  98.3%  99.1%  98.7% 
2  192  199  191  1  8  95.9%  99.4%  97.6% 
3  53  57  53  0  4  92.2%  100%  96.3% 
4  15  13  13  2  0  100%  86.6%  92.8% 
5  99  108  95  4  13  87.9%  95.9%  91.7% 
6  298  350  297  1  53  84.8%  99.6%  91.6% 
7  73  82  72  1  10  87.8%  98.6%  92.9% 
8  28  31  26  2  5  83.8%  92.8%  88.1% 
9  41  47  40  1  7  85.1%  97.5%  90.9% 
10  34  37  32  2  5  86.4%  94.1%  90.1% 


Total  950  1042  935  15  107  90%  98%  94% 
Summary of results for RBCs.
Set  Manual count  Proposed method count  TP  FN  FP  PR  RC  FM 

1  2117  2123  2076  41  47  97.7%  98%  97.9% 
2  2553  2586  2474  79  112  95.6%  96.9%  96.2% 
3  2484  2529  2443  41  86  96.5%  98.3%  97.4% 
4  3788  3799  3689  99  110  97.1%  97.3%  97.2% 
5  4899  5107  4798  101  309  93.9%  97.9%  95.9% 
6  4887  5133  4699  188  434  91.5%  96.1%  93.7% 
7  5195  5228  5007  188  221  95.7%  96.3%  96% 
8  4223  4341  4190  33  151  96.5%  99.2%  97.8% 
9  4474  4588  4394  80  194  95.7%  98.2%  96.9% 
10  4974  5044  4842  132  202  95.9%  97.3%  96.6% 


Total  39594  40478  38612  982  1866  95%  98%  96% 
Table
Table
Figure
RBCs detected by the proposed method.
Overlapping cells detected by the proposed method.
Additionally, our proposed method was able to perform for cases with irregularly shaped cells. Figure
Real case example of irregular cells detected.
Tables
(a) Sample from our results for normal cases and (b) staining problem in some cases.
(a) Wrong detection in some case from our proposed method and (b) preprocessing problem.
We evaluate our proposed method’s result using a simple least square method in RANSAC algorithm. We take 40 random samples from our automatic and its corresponding manual counting results and apply them on the RANSAC algorithm. Our findings show that the selected results consistently fit a regression line as shown in Figure
The outliers have no influence on our proposed result as it consistently fits in a regression line.
The average accuracy of the proposed method was 97.5% for RBCs and 98.4% for WBCs. We compared our proposed method with the method presented in [
Putzu and di Ruberto [
Accuracy of the proposed method compared with other methods.
Method  RBCs  WBCs  RBC’s  

Average accuracy  Average accuracy  PR  RC  FM  
Colorbased and Hough transform [ 
64%  81%  
Morphology operators and watershed algorithm [ 
—  93.5%  
Basic Circular Hough Transform (CHT)  67%  —  71%  68%  71% 
Our proposed method  97.5%  98.4%  95%  98%  96% 
Furthermore, we also have conducted similar experiment using the same dataset and the same preprocessing steps using the classic circular Hough Transform CHT [
(a) CHT RBCs detection results and (b) our proposed method RBCs detection results in overlapping cells.
In case of other cases irregular cells, our proposed method presents a better performance than CHT in that case as shown in Figure
(a) CHT performance when detecting irregular cells and (b) the proposed method performance when detecting irregular cells.
This paper proposed a method to automate the segmentation and counting of red and white blood cells using iterative structured circle detection algorithm. Several improvements were made to the RCD algorithm, including an initialization step to find 8neighbor connected component. Additionally, the proposed model features an enhanced probability of selecting the correct circle from four candidate circles, the capability to detect irregular cells, the use of dynamic number of iterations, and improved detection of overlapping cells. The proposed method performed the segmentation and counting of WBCs and RBCs well when results were compared with the ground truth, which was determined by experts. The following segmentation and counting accuracies were achieved using the proposed method: PR = 89.7%, RC = 98.4%, and
The authors declare that there is no conflict of interests regarding the publication of this paper.
The authors would like to thank to Universiti Kebangsaan Malaysia and Ministry of Education for providing facilities and financial support under “AP2012019 Automated Medical Imaging Diagnostic Based on Four Critical Diseases: Brain, Breast, Prostate and Lung Cancer” and FRGS/1/2012/SG05/UKM/02/8 Grant entitled “Generic Object Localization Algorithm for Image Segmentation.” Special thanks to Dr. Reena Rahayu Md Zin who had worked hard on giving ideas.