1 Introduction

Malaria is the symptom of acute febrile infection. It is caused because the plasmodium parasite of red blood cells [1]. About 3.2 billion people remain at risk of malaria. In 2015 alone, there were an estimated 214 million new cases of malaria and 438,000 deaths [2]. Millions of people are still not accessing the services they need to prevent and treat malaria [2]. Depending on the type of plasmodium, malaria treatment is different. To reduce the progression of infection, a fast and accurate diagnosis at an early stage is very important [3, 4]. Until now, the diagnosis of malaria is carried out using the Giemsa staining the infected blood and a standard test procedure is followed to read the thin smear and the thick smear on the obtained microscopic image. Though this method is relatively economical and detects the possible parasites and the distinction of species, the results are subjective and need high skills [5]. But this method is inadequate because of complex, labor-intensive and long duration tests.

Therefore, the image processing algorithm is developed as a way of establishing the standardized inspection procedure in order to determine the extent of malaria infection. This process is derived as an alternate procedure to improve the inefficiency of conventional testing method. The present study was carried out through the microscope image of the blood infected with malaria. The degree of infection was determined by detecting the plasmodium that causes malaria. The series of processes includes the procedure to check the quantity plasmodium in each of red blood cells (RBCs). The proposed algorithm is composed of morphological image processing technique to clearly divide the RBCs in the micrograph which are infected and then using clamp splitting method and HSV color image processing to categorize them as infected.

2 Parasitemia Evaluation Methods

Evaluation algorithm for detecting the degree of blood infection, using MATLAB software, was designed with respect to plasmodium infected red blood cells (RBCs) images. This process enables the algorithm to distinguish between infected and uninfected RBCs images. In order to determine parasitemia values, the proposed algorithm is composed of morphological image processing technique to effectively identify the infected and uninfected RBCs. The algorithm also detects the plasmodium penetration into the RBCs which is a key configuration in the series of processes. The algorithm is made as a standardized test procedure through color image processing based on the HSV color space technique providing a quantitative analysis on the blood samples.

2.1 Preprocessing

RBCs images have some preprocessing steps which involves the conversion of the original image into gray scale image and the enhancement its contrast by adaptive histogram equalization [6, 7, 8]. The value of adaptive histogram equalization was determined by Otsu’s method. Through these two processes an improved image is obtained for the next stage. Figure 1 shows a prior image and subsequent image with respect to the preprocessing. Figure 1b shows the grey scale image of the actual microscopic image which categorically distinguishes the RBCs in the sample (Fig. 2).

Fig. 1
figure 1

Adaptive histogram equalization. a Original image. b Grey scale image

Fig. 2
figure 2

Edge detection. a Grey scale image b Edge image

2.2 Edge Detection

The Sobel edge detector uses two 3 × 3 kernels which are convolved with the original image to calculate approximations of the derivatives, one for horizontal changes, and one for vertical.

Edge detection is a general term of the mathematical method to determine the point in the digital image which detects the change in the brightness of the image if it changes rapidly or having a discontinuity.

Edge refers to a point which is composed of a set of typical curve segment to radically change the brightness of the image. Therefore, applying the image edge detection algorithm can reduce the amount of data to be handled markedly, while maintaining the important structural characteristics of the image and filter the lower priority information.

The Sobel edge detector (SED) is a discrete differentiation operator, computing an approximation of the gradient of the image intensity function. At each point in the image, the result of SED is either the corresponding gradient vector or the norm of this vector. SED uses the masks in Fig. 3 to approximate digitally the first derivatives Gx and Gy. In other words, the gradient at the center point in a neighborhood is computed as follows by SED [9, 10].

Fig. 3
figure 3

SED mask

$$ {\text{G}} = \left[ {G_{x}^{2} + G_{y}^{2} } \right]^{{\frac{1}{2}}} = \left\{ {\left[ {\left( {z_{7} + 2z_{8} + z_{9} } \right) - \left( {z_{1} + 2z_{2} + z_{3} } \right)} \right]^{2} + \left[ {\left( {z_{3} + 2z_{6} + z_{9} } \right) - \left( {z_{1} + 2z_{4} + z_{7} } \right)} \right]^{2} } \right\}^{{\frac{1}{2}}} $$
(1)

A pixel at location \( \left( {x, y} \right) \) is an edge pixel if \( {\text{g }} \ge {\text{T}} \) at that location, where T is a specified threshold.

2.3 Edge Link

If the edge detection procedure is successful, the subsequent operations for interpreting the contents of the image information can be substantially simplified. However, it is not possible to obtain an ideal edge, such as the actual image of the appropriate complexity. For this reason, it may represent a potential corresponding to the discontinuity of the image brightness. Edges are extracted from the non-trivial image, which do not complicate the subsequent operations to interpret the image data corresponding to the respective conditions of interest in the image. This means that not only the edge segments are connected by a curved edge as false edges or omissions. Edge detection is a technique of the basic steps in a variety of fields such as image processing, image analysis, image recognition, computer vision. Therefore, the edge link has been recognized as an essential step in the image processing procedure.

Derived edges are connected to each other at their link points that forms closed perimeter around the RBCs. Link points are close the shape of edge lines using 20 kinds of different 3 × 3 masks shown in Fig. 4. Such edge link mask is connected to each link of all points through the scanning area with respect to the image size of 1300 × 1030.

Fig. 4
figure 4

Edge link image and mask

2.4 Morphological Operation

For RBCs images segmentation, the morphological operation was composed of following 3 sequential steps: (1) flood-fill operation, (2) remove invalid RBCs and noise, (3) detect overlap RBCs. As a prerequisite for the processing of the following steps, the following Fig. 5 shows the result of each step in the morphological operation.

Fig. 5
figure 5

Morphological operation. a Edge linked image. b Flood-fill image. c Remove invalid RBCs and noise. d Detect overlap RBCs

First, based on the edge image linked, a flood-fill operation on background pixels (that is internal pixels of the linked edge contour) of the input binary image was performed. However, due to the presence of one linked edge contour inside another linked edge contour, the flood-fill operation is not performed accurately. In other words, a black cavity occurs in the image of the white colored RBCs in which the flood-fill operation is performed. Opening and closing operation was carried out to improve this phenomenon. Opening generally smoothen the contour of an object, breaks narrows isthmuses, and eliminates thin protrusions. Closing also tends to smooth sections of contours but, as opposed to opening, it generally fuses narrow breaks and long thin gulfs, eliminates small holes, and fills gaps in the contour [11, 12].

The opening of set A by structuring element B, denoted A ∘ B, is defined as

$$ {\text{A }} \circ {\text{B}} = \left( {{\text{A}}{ \ominus }{\text{B}}} \right) \oplus {\text{B}} $$
(2)

Thus, the opening A by B is the erosion of A by B, followed by a dilation of the result by B. Similarly, the closing of set A by structuring element B, denoted A · B, is defined as

$$ {\text{A }} \cdot {\text{B}} = \left( {{\text{A}} \oplus {\text{B}}} \right){ \ominus }{\text{B}} $$
(3)

It means that the closing of A by B is simply the dilation of A by B, followed by the erosion of the result by B.

Second, in order to remove invalid RBCs and the image noise the following two methods are used. One is the method for removing the edge line contacting the outermost pixel on the image that is to say the removal of invalid RBCs creates the outermost pixel line of the image. It connects the outermost pixel line to the adjacent linked edge line. Then it removes one connected line with the image coordinates of the outermost pixel of the image, the other is the method for removing objects smaller than the size of typical RBCs. In the process of removing noise from the image, the size of the smallest RBC is calculated based on the number of pixels, and the largest noise is calculated. The threshold value is set by the two calculated sizes.

Third, labeling was performed as the first step to detect the overlap RBCs. As a result of labeling, all RBCs are merged into one object with or without overlapping. The objects which were rolled into one have morphological differences. Identification of distorted values based on the roundness of each object is a criterion of distinguishing the overlap RBCs. Therefore the reason for performing the labeling is that it is possible for the roundness numerically confirmed. Roundness of overlap RBCs is close to zero, the roundness of the correct circle is expressed as 1, since the roundness means a correct circle. In this research, the RBCs were determined to overlap less than 0.6, because the threshold value of the roundness was set to 0.6 (Figs. 6, 7).

Fig. 6
figure 6

Remove invalid RBCs and noise. a Create the outermost pixel line and connection. b Remove one connected line. c Images with RBCs and noise coexist. d RBCs image without noise

Fig. 7
figure 7

Detect overlap RBCs. a Mark the overlap value based on roundness. b Indicate overlap RBCs

2.5 Clump Split

The purpose to enforce Clump split overlap on RBCs is to improve significantly the accuracy in the evaluation process of parasitemia. That is, as shown in Fig. 8, it arises a problem that even the overlap of two RBC recognized as one RBC. Then, the clump split method [13, 14, 15] is used to split clumps of two or more RBCs into constituent cells. For the contents of this process, the process is shown through the following in Fig. 8 and has been explained based on it. Processed results by the clump split method is shown in Fig. 9.

Fig. 8
figure 8

Clump split method

Fig. 9
figure 9

Clump split image. a Before clump spit. b After clump split. c Before clump spit. d After clump split

Concavity depth \( \overline{CD} \) is a concaveness measure proposed by Rosenfeld [16]. First the group \( K_{i} \) of convex hull segment can be obtained from image boundary. Then calculating the maximum distance between each segment it can be acquired for four pixels, there are composed of \( K_{1} , K_{2} , K_{3} , K_{4} \). Using these four pixels may draw the two tangents \( \overline{{K_{1} K_{3} }} \;{\text{and}}\;\overline{{K_{2} K_{4} }} \). Each pixel on the boundary between \( K_{1} \) and \( K_{3} \) has a concavity depth value, which is the rectilinear distance from the corresponding tangents \( \overline{{K_{1} K_{3} }} \). Where the distance from \( K_{1} \) to \( C_{i} \) is a value that can be seen by the calculation. This calculation process is continued until the calculated maximum value of the concavity depth \( \overline{{CD_{1} }} \). Also each pixel on the boundary between \( K_{2} \) and \( K_{4} \) has a concavity depth value, which is the rectilinear distance from the corresponding tangents \( \overline{{K_{2} K_{4} }} \). Where the distance from \( K_{2} \) to \( C_{i} \) is a value that can be seen by the calculation. This calculation process is continued until the calculated maximum value of the concavity depth \( \overline{{CD_{2} }} \). After performing this iterative process, finally, it turns the value of the closest pixel in clump split line \( \overline{{C_{i} C_{i + n} }} \).

2.6 Parasites Detection

To detect malaria parasites and the method using the Giemsa stain, Plasmodium is stained with a purple throughout the process (Fig. 10). In order to extract these characteristics through the Figs. 11 and 12 compare the RGB image and HSV image. The results were excellent in the HSV image.

Fig. 10
figure 10

Giemsa stain image

Fig. 11
figure 11

RGB image and components. a RGB image. b R component. c G component. d B component

Fig. 12
figure 12

HSV image and components. a HSV image. b H component. c S component. d V component

Hue, saturation, value (HSV) is one of several color system used by people to select colors (e.g., of paints or inks) from a color wheel or palette. These color systems is very closer than the RGB system to humans experience and expression about color sensations [9, 17,18,19].

For parasites detection, it can be divided following 4 sequential steps: (1) HSV conversion, (2) S component analysis, (3) parasites detection, (4) image registration.

In a color image, the sub-images in red, green, and blue are very analogous to each other. The separation of parasites in gray levels is not proper. The parasites were found to be different in color. Therefore, hue–saturation–value color space is analyzed as shown in Fig. 12. A bright object is a viewpoint in hue component; H and saturation; S. This is because Giemsa staining solution colors hexane. That is, RGB colors emphasized in these objects look dark and are colored in purple [20, 21]. Therefore, the white cells and parasites that include RGB are much brighter in images than other objects. This is why saturation components are used in color images (Fig. 13).

Fig. 13
figure 13

Parasites detection. a HSV image. b S component. c Parasites detection. d Infected RBCs detection. e Image registration on binary image. f Image registration on RGB image

3 Experimental Results

Figure 14 shows the parasites evaluation results obtained using the MATLAB tool. The microscopic image of the blood sample is processed through various preprocessing, processing and post processing stages. Evaluation algorithm for blood infection degree, using MATLAB software, were designed with respect to red blood cells (RBCs) image infected with parasites of the plasmodium to distinguish uninfected RBCs image. Briefly, this involved the detection of the infected RBC using preprocessing (which involves the conversion of gray scale and the enhancement of the image contrast by adaptive histogram equalization (Fig. 15).

Fig. 14
figure 14

Parasites evaluation results

Fig. 15
figure 15

Clump split results

The value of adaptive histogram equalization was determined by Otsu’s method), edge detection (It uses two 3 × 3 kernels which are convolved with the original image to calculate approximations of the derivatives, one for horizontal changes, and one for vertical), edge link (Link points are close the shape of edge lines using 20 kinds of different 3 × 3 masks. Such edge link mask is connected to each link of all points through the scanning area with respect to the image size of 1300 × 1030), morphological operation (It was composed of flood-fill operation, remove invalid RBCs and noise, detect overlap RBCs), clump split (Which is used to split clumps of two or more RBCs into constituent cells), parasites evaluation (it can be divided HSV conversion, S component analysis, parasites detection, image registration.). Subsequently, parasite infection is identified based on the S component analysis of converted HSV image. These color systems are very closer than the RGB system to humans experience and expression about color sensations. It was found that all these extensive steps have improved processing of the image and assisted in evaluating the number of cells that are infected with malaria. When compared to the existing process to identify malaria infection, this procedure is fast, accurate, economical and does not require high skills to interpret the results. The interface tool is designed in such a way that the sequencing is given in the order in which the procedure should be executed and therefore reduces the ambiguity in evaluating the results. The result table gives the RBC count, number of infected RBC and % of parasitemia present in the blood sample. The results also indicate that that the method is robust and accurate.

4 Conclusions

  1. 1.

    In order to determine the extent of malaria infection, the image processing algorithm was developed as a way of establishing the standardized inspection procedures.

  2. 2.

    This process is derived and resulted in the improvement to the inefficiency of conventional testing method.

  3. 3.

    The present study was carried out through the microscope image of the blood infected with malaria, to help determine the degree of infection by detecting the plasmodium that causes malaria.

  4. 4.

    The series of processes are procedural connected to check the quantity of each of red blood cells (RBCs).

  5. 5.

    The proposed algorithm is composed of morphological image processing to clearly divide the RBCs in the micrograph of infected RBCs and clamp splitting method, also to detect a plasmodium penetration into RBCs.

  6. 6.

    It was constructed as a standardized test procedure through color image processing based on the HSV color space and morphological image processing techniques.

  7. 7.

    The results obtained are robust with an efficiency of 40% over the conventional techniques in terms of speed and accuracy.