(i) | Input: an image to read. |
(ii) | Output: the detection and classification of leukemia: AAL or AML. |
(1) | Read an image from a file and display it. |
(2) | In the preprocessing phase: separate foreground and background. |
(3) | Transform the resultant image into gray image. |
(4) | Extract values of RGB from the original image. |
(5) | Image segmentation: mapping between foreground values and RGB values is performed to increase the contrast. |
(6) | Compute the radius of every blood cell in the corresponding gray image and save results in a matrix radi. |
(7) | Determine black cells and estimate their radius as well. |
(8) | Draw a red line around every dark cell, determine their numbers, and save results in a variable x. |
(9) | Detect white blood cells and draw green rectangle around them. |
(10) | Determine number of white and red blood cells. |
(11) | Calculate a threshold of every detected infected cell using Otsu’s approach to minimize the variance between the white and black cells in the gray image and save the results in a variable thre. |
(12) | Convert the gray image into the binary image using the threshold to locate the potential areas of all detected infected cells. |
(13) | Label all infected cells and mark them on the original image as well. |
(14) | Remove all unwanted, healthy blood cells using the erosion function. |
(15) | Segment all contiguous regions of interest into distinct objects using a built-in function. |
(16) | Determine the location of infected cells and their corners using the Harris–Stephens method. |
(17) | Extract features from infected cells using AlexNet, CNN, technique. |
(18) | For i = 1: number of infected blood cells. |
(19) | Apply SVM to classify every infected blood cell whether it is AAL or AML. |
(20) | Determine the percentage of leukemia and save result in a variable y. |
(21) | Determine the status of leukemia. |
(22) | Display a message to patients. |
(23) | End |
(24) | End of algorithm. |