You are on page 1of 108

Leukemia detection using image processing by matlab

A PROJECT REPORT ON

LEUKEMIA DETECTION USING


IMAGE PROCESSING BY MATLAB
submitted in partial fulfillment for the award of the degree Of

BACHELOR OF TECHNOLOGY

in

ELECTRONICS & COMMUNICATION ENGINEERING


By

Gottimukkala Sravani (188X5A0423)


Bommanaboyina PrasannaSrujana (178X1A0424)
Basava Sai Rohith (178X1A0416)
Challa Pavan Kumar (178X1A0427)
Allaparthi Sagarika (188X5A0401)

Under The Esteemed Guidance Of


Dr. K. RAJKAMAL
B.Tech, M.Tech., Ph.D
Assoc.prof, Dept. of ECE

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING


KALLAM HARANADHAREDDY INSTITUTE OF TECHNOLOGY
(APPROVED BY AICTE, NEW DELHI, AFFLICATED TO JNTU-KAKINADA)
ACCREDITTED WITH NAAC ‘A’ GRADE
NH-5, CHOWDAVARAM, GUNTUR-522019
(July 2021)

DEPT OF ECE I KHIT


Leukemia detection using image processing by matlab

KALLAM HARANADHAREDDY INSTITUTE OF TECHNOLOGY


(APPROVED BY AICTE, NEW DELHI, AFFLICATED TO JNTU-KAKINADA)
ACCREDITTED WITH NAAC ‘A’ GRADE
NH-5, CHOWDAVARAM, GUNTUR-522019
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

CERTIFICATE
This is to certify that the project report entitled “LEUKEMIA DETECTION
USING IMAGE PROCESSING BY MATLAB” is submitted by
G.SRAVANI(188X5A0432), B.PRASANNASRUJANA(178X1A0424),
B.SAI ROHITH(178X1A0416), C.PAVAN KUMAR(178X1A0427),
A.SAGARIKA(188X5A0401) to the Jawaharlal Nehru Technological University
Kakinada in partial fulfillment for the award of Degree of Bachelor of Technology
in Electronics and Communication Engineering is a bonafide record of the project
work carried out by them under my supervision during the year 2017-2021.

PROJECT GUIDE HEAD OF THE DEPARTMENT


Dr.K.RAJ KAMAL Ph.D Dr. K. V. RAMPRASAD
Assoc.prof, Dept. of ECE PROFESSOR,HOD&DEAN,
DEPARTMENT OF ECE,

PROJECT CO-ORDINATOR EXTERNAL


EXAMINER

DEPT OF ECE II KHIT


Leukemia detection using image processing by matlab

ACKNOWLEDGEMENT

We profoundly express our gratitude and respect towards our honorable chairman
Sri Kallam Haranadhareddy kallam group for his precious support in the college.

We are thankful to our Director Dr. M. Umashankarreddy for his


encouragement and support for the completion of project. We are inspired a lot through
his valuable message.

We express our great pleasure to our Principal Dr. B. S. B. REDDY for his
support during the project work.
We express our sincere thanks to Dr. K. V. RAMPRASAD Head of Electronics
and Communication Engineering Department, KHIT and guide for his
encouragement and guidance in bringing shape to this project.

We are really thankful to our project guide Dr K.RAJKAMAL, Associate Professor, KHIT,
Guntur, for his/her excellent guidance right from selection of the project and his/her
valuable suggestions throughout the project work

We are thankful to our project coordinator Dr.S.Sri Jayalakshmi, Associate


Professor in Electronics& communication Engineering for her excellent guidance right
from the selection of the project and her valuable suggestions throughout the project work.

We are thankful to all teaching and non-teaching of Electronics and Communication


Engineering department and management and my friends for their direct and indirect work
provided to use in completing the project.

We own all our success to our family members, classmates and teachers from our
childhood, whose vision, love and inspiration made us to reach out for these glories

GOTTIMUKKALA SRAVANI (188X5A04323)


BOMMANABOYINA PRASANNASRUJANA (178X1A0424)
BASAVA SAI ROHITH (178X1A0416)
CHALLA PAVAN KUMAR (178X1A0427)
ALLAPARTHI SAGARIKA (188X5A0401)

DEPT OF ECE III KHIT


Leukemia detection using image processing by matlab

DECLARATION

We hereby declare that the entire project work embodied in this dissertation
entitled “LEUKEMIA DETECTION USING IMAGE PROCESSING BY
MATLAB” been independently carried out by us. As per our knowledge no part of
this work has submitted for any degree in institution, university, an organization
previously. We hereby boldly state that for the best of our knowledge our work is
free from plagiarism.

GOTTIMUKKALA SRAVANI (188X5A0423)


BOMMANABOYINA PRASANNASRUJANA (178X1A0424)
BASAVA SAI ROHITH (178X1A0416)
CHALLA PAVAN KUMAR (178X1A0427)
ALLAPARTHI SAGARIKA (188X5A0401)

DEPT OF ECE IV KHIT


Leukemia detection using image processing by matlab

TABLE OF CONTENTS
PG NO
Project report I
Certificate II
Acknowledgment III
Declaration IV
Table of contents V
List of figures VII
Abstract 1

Chapter No. Topic Pg. No.

Chapter 1 Introduction 02

1.1 Explanation 03

1.2 Types of leukemia 04

1.3 Types of chronic luekemia 06

1.4 Types of acute leukemia 07

Chapter 2 Problem Definition & Objective 10

2.1 Risk factors 11

2.2 Symptoms of leukemia 14

Chapter 3 Literature Survey 18

Chapter 4 Existing systems 23

4.1 different methods to diagnosis leukemia 24

4.2 Complication of leukemia 27

4.3 Prognasis of leukemia 28

DEPT OF ECE V KHIT


Leukemia detection using image processing by matlab

Chapter 5 Proposed systems 29

5.1 Methodology 31

5.2 Process of Explanation 35

Chapter 6 Types of segmentation process 46

6.1 Watershed Transform 47

6.2 K – Mean clustering 51

6.3 Histogram equalization and linear stretching 54

Chapter 7 Color Segmentation Techniques 58

7.1 RGB color space module 60

7.2 CMYK color space module 60

7.3 YCBCR color space module 61

Chapter 8 Tools to be used 62

8.1 Matlab 63

8.2 GUI on Matlab 63

Chapter 9 Expected results 64

9.1 Code Results 65

9.2 Advantages 65

9.3 Diadvantages 65

9.4 Program execution result 66

9.5 Final Outcome 68

DEPT OF ECE VI KHIT


Leukemia detection using image processing by matlab

Chapter 10 Future scope 69

Code Appendix 72

References 93

DEPT OF ECE VII KHIT


Leukemia detection using image processing by matlab

LIST OF FIGURES

Sr. No Figures Page No


1. Comparision between the normal blood sample and 5
leukemia

2. Chronic Myelogenous Leukemia 6

3. Chronic Lymphocytic Leukemia 6

4. Acute Lymphocytic Leukemia 7

5. Acute Myelogenous Leukemia 8

6. Types of cancer cells 8

7. Types of leukemia 8

8. Child after vs before Leukemia 12

9. Bone Anatomy 15

10. White blood cell 2. Red blood cell 3. Platelets 16

11. The Formation of Myeloid and Lymphoid


Series of Cell 17

12. Extraction of sample of bone marrow from 25


your hipbone

13. Flow chart 1 32

14. Flow chart 2 33

15. Block diagram 34

DEPT OF ECE VIII


KHIT
Leukemia detection using image processing by matlab
16. Blood smear image 35

17(a). Contrast Stretching 36

17(b). Gray-Scale image 36

17. Image Preprocessing 36

18. Shows the image enhancement after applied


median filtering. 38

19. Gradient Magnitude 39

20. Morphological Process 41

20(a). Opening 41

20(b). Erosion 41

20(c). Closing 41

20(d). Dilation 41

21. Red channel image after applying


Segmentation 42

22. Watershed output of the image 43

23. Block Diagram of Watershed Transform 48

24. Process of watershed method 49

24(a). Original Image 49

24(b). RGB to HSV color model 49

24(c). Saturation component 49


24(d). Derivation of gradient magnitude 49
24(e). Area opening 49
24(f). Opening-Closing 49
24(g). Detect white cell using colored 49
watershed label matrix

DEPT OF ECE IX KHIT


Leukemia detection using image processing by matlab
24(h). Detection of white cell superimposed 49
transparency on original image
25. Block Diagram of K-Mean Segmentation 52
26. Process of K-Mean Segmentation 54

26(a). Original Image 53


26(b). Image labeled by Cluster Index 53
26(c). Cluster of Red Cell 53
26(d). Cluster of White cell 53
27. Process of Histogram Equalization and 53
Linear Contrast Stretch

27(a). Original Image 54


27(b). RGB to gray image 54
27(c). Linear contrast 54
27(d). Histogram equalization image 54
27(e). Addition of L and H 55
27(f). Subtraction of L and H 55
27(g). Addition of e and f 56
27(h). Thresholding method 56
27(i). Removal of small particles 56
27(j).` Edge detection by sobel operator 56
28. Color space of RGB and CMYK along with
YCbCr color space 59
66
29. Result from code – 1
67

30. Result from code – 2 67


30(a). Enhancing the image 67
67
30(b). Detection of red blood cells
67
30(c). Detection of cancer cells

31. Result from code – 1,2 68

DEPT OF ECE X KHIT


Leukemia detection using image processing by matlab

68
32. Calculation of centres and radii of cells

33. Cancer detection of using smart phone camera 70


34. Comparison between smartphone and
pathological instrument 71

DEPT OF ECE XI KHIT


Leukemia detection using image processing by matlab

ABSTRACT
Leukemia is a type of cancer that affects the white blood cells. This affected white
blood cells capture the bone marrow and the bone marrow is the soft material inside the of
most bone. The abnormal white blood cells stay in bone marrow and reproducing in an
uncontrolled way.. Its cure rate and prognosis depends mainly on the early detection and
diagnosis of the disease. At the moment, identification of blood disorders is through visual
inspection of microscopic images by examining changes like texture, geometry, colour and
statistical analysis of images. Its cure rate and prognosis depends mainly on the early detection
and diagnosis of the disease objective of this project will be to detect the leukemia affected cells
and count it. According to detection of immature cells leukemia can be identified and also define
that either it is chronic or acute For this project with the help of image processing technique
we will detect Leukemia using microscopic image various image processing technique are
used for identification of red blood and immature white cells. To detect immature cells
number of methods are used like histogram equalization, linear contrast stretching, some
morphological techniques like area opening, area closing, erosion, dilation.

At the moment, identification of blood disorder is through visual inspection of


microscopic images by examining changes like texture, geometry, colour and statistical
analysis of images Image analyzing is very important role play in the diseases of leukemia
can be detected and diagnosed at earlier stage. Images are used as they are cheap and do
not require expensive testing and lab equipment, and we used detection of leukemia cells
in the normal blood cells using MATLAB.
This concept doesn‟t require any medicinal device or a person skilled in medicinal field.
Require almost no man-power. This technology can come to use in detection many other
disease like anemia, malaria, deficiency of vitamin B12, brain tumor detection etc.
Here we detect the leukemia by using colour segmentions methods.
They are mainly 3 types :
1.RGB
2.CMYK
3.YCbCr

DEPT OF ECE 1 KHIT


Leukemia detection using image processing by matlab

CHAPTER - 1
INTRODUCTION

DEPT OF ECE 2 KHIT


Leukemia detection using image processing by matlab

1.1 Explanation :

There are many types of cancer. Cells in any part of the body can become cancerous
when cells in the body begin to grow uncontrolled. Leukemia is cancer that starts in blood
cells. Leukemia is divided based on whether the leukemia is acute (fast-growing) or chronic
(slower-growing), and whether it starts with myeloid cells or lymphoid cells.

There are different types of white cells in our body. Leukemia is nothing but cancer
of blood cells in which number of white cells is increasing and those are immature cells
that destroy other cells. Today laboratory test takes longer interval of time to diagnose the
disease of leukemia and it is also time consuming, prone to human error and also tedious.
The ratio of white blood cell in our body is 1000:1. It means that 1 white blood cell is
present between 1000 red cell. So if number of white blood cells increase remarkably in
large number then the person is succumbed to suffer from the leukemia. It further falls into
two type: acute and chronic. If number of white cell is increasing in our body then this
immature cells start destroying another cells of our body.

So we need to use the technology that identifies different types of blood cells within
short duration of time in emergency.

Furthermore it is vital to study in detail how to differentiate different cell and


recognize it as immature cell and according to it, detect the leukemia. Acute and chronic
also have two types. 1) Lymphocytic and 2) Myeloblastic that both are due to immature
blast of lymphoid and myeloid cell respectively.

The task can be improved and performed in near-real time environment using
biomedical image processing.

Leukemia is generated from the bone marrow. It can be Cause of death if treatment
is not started at right time. A Thin material is situated inside each bone which is known as
Bone marrow.

DEPT OF ECE 3 KHIT


Leukemia detection using image processing by matlab

Every human body has Mainly three type of blood cells:-RBC(red blood
Cell),WBC(white blood cell),PLT(platelets).In this paper main Point of concern is to
detect leukemia. So we are only Concentrating on the count of WBC(leucocytes).There are
Two type of stem cell, myeloid and lymphoid stem cell.Myeloid stem cell emerges into
myeloid Blast. This myeloid blast is the reason for generating of
RBC(erythrocytes),WBC(leucocytes) and platelets. Lymphoid Stem cell also enduces
lymphoid blast which will generate Only the white blood cell(WBC).Bone marrow
produces Abnormal white blood cells(wbcs).These abnormal cells Should die after some
time but in reality they do not die and They become numerous in count. The normal white
blood cells Are interrupted by those abnormal white blood cells in doing Their normal
work. And this type of situation is named as Disease like Leukemia.

1.2 Types of leukemia :


Leukemia can be classified into Chronic and Acute leukemia.
1. Chronic Leukemia:- Abnormal white blood cells perform like Normal white
blood cells and they will increase rapidly.
2. Acute Leukemia:- Abnormal white blood cells do not perform Like normal cells
and they will increase rapidly in number.

Figure 1:- comparision between the normal blood sample and leukemia.

DEPT OF ECE 4 KHIT


Leukemia detection using image processing by matlab

In a person with leukemia, the bone marrow makes and presents abnormal white
blood cells. The abnormal white cells are leukemia cells present in the human.

Unlike normal blood cells are leukemia cells these cells not die when they
produce. They may attach to the normal white blood cells, red blood cells, and
platelets. This abnormal cell makes difficult for normal blood cells to do their
work properly.

The types of leukemia can be grouped based on how quickly the disease

develops and gets worse. Leukemia is either chronic (which usually gets
worse slowly) or acute (which usually gets worse quickly)There are two
common types of chronic leukemia:

1.Chronic leukemia: In chronic leukemia is not detected to the primary stages


because in the primary stage this type of leukemia not affect the working of
normal white blood cells and for this reason the patient not finding any types of
symptoms. Doctors often find chronic leukemia during a routine check-up before
there are any symptoms.

Slowly, chronic leukemia gets worse and the number of leukemia cells in the
blood increases, patient get symptoms, such as swollen lymph nodes or
infections. When symptoms appear this indicates that leukemia is at its last stage
that means it capture the maximum part of the blood cells and bone marrow they
are usually mild at first and get worse gradually.
1.3 Types of chronic leukemia :
There are two common types of chronic leukemia:
1. Chronic Myelogenous Leukemia (CML) – also known as a myeloproliferative
disorder. CML cells shown in Figure-5. It is a disease in which bone marrow cells
proliferate outside of the bone marrow tissue. It affects lymphoid cells and grows
quickly.

DEPT OF ECE 5 KHIT


Leukemia detection using image processing by matlab

Figure 2 :- Chronic Myelogenous Leukemia

2. Chronic Lymphocytic Leukemia (CLL) – Chronic lymphocytic leukemia mostly


detected to the adults.In which lymphocytes look fairly normal but are not fully mature
and do not function correctly against abnormal cells. The malignant or abnormal cells
are found in blood cells and bone marrow, collect in and enlarge the lymph nodes. CLL
cells shown in Figure.

Figure 3 :- Chronic Lymphocytic Leukemia

2. Acute leukemia: In acute leukemia also in the primary stage of leukemia, leukemia
cells can not affect the working of normal white blood cells. But in the next stage this
leukemia cells increases rapidly and uncontrolled. The types of leukemia also can be
grouped based on the type of white blood cell that is affected. See the picture of these
cells.
There are two common types of acute leukemia:

DEPT OF ECE 6 KHIT


Leukemia detection using image processing by matlab

1.4 Types of Acute leukemia :


1. Acute Lymphocytic Leukemia (ALL) – also known as acute lymphoblastic
leukemia. It is rapidly progressing form of leukemia that is characterized by the
presence in the blood and bone marrow of large number of unusually immature
white blood cells destined to become lymphocytic. ALL cells shown in Figure.

Figure 4 :- Acute Lymphocytic Leukemia

2. Acute Myelogenous Leukemia (AML) – also known as acute nonlymphocytic


leukemia (ANLL). This is the most common form of adult leukemia. It affects
myeloid cells and grows quickly. Leukemic white blood cells collect in the bone
marrow and blood. AML cells shown in Figure.

Figure 5 :- Acute Myelogenous Leukemia

From above all discussion images of leukemic cells ALL, AML, CLL, or CML
shown in following figure. Here (a)ALL (b)AML (c)CLL (d)CML

DEPT OF ECE 7 KHIT


Leukemia detection using image processing by matlab

Figure 6 :- Types of cancer cells

Figure 7 :- Types of leukemia

DEPT OF ECE 8 KHIT


Leukemia detection using image processing by matlab

Table 1 :- types of leukemia

Leukemia types Description

Acute • Speedy growth of immature blood cells


• Occur usually in young adults and
children
• Requires on-time treatment

Chronic • Build mature blood cells excessively


• Occur generally in older patients
• Examining before the treatment

Lymphoid • Effects plasma as well as lymphocytes


cells
• It is lymphocytic leukemia

Myeloid • Effects basophils, eosinophils and


neutrophils
• It is myelogenous leukemia

DEPT OF ECE 9 KHIT


Leukemia detection using image processing by matlab

Chapter 2
Problem Definition & Objective

DEPT OF ECE 10 KHIT


Leukemia detection using image processing by matlab

Leukemia is generated from the bone marrow. It can be cause of death if


treatment is not started at right time. A thin material is situated inside each bone
which is known as bone marrow. Every human body has mainly three type of blood
cells:- RBC(red blood cell), WBC(white blood cell), PLT(platelets).For this
project main point of concern is to detect leukemia. So we are only concentrating
on the count of WBC(leucocytes).

The main objective was to enhance algorithms that can detect disease from human
blood images during their earlier stages in order to prevent them from worsening.
The separation of overlapping cells is a great help for the image quantitative
analysis and image recognition. Using an algorithm based on watershed algorithm
to divide the overlapping cells from each other, the results show good findings for
the overlapping cells. With that, a software application that can separate
overlapping cells in the blood images for better detection of leukemia was
developed.
The satisfactory causes of leukemia are unidentified and in most case, it's
unsettled why leukemia has developed. Research into possible causes is going on all the
time. Like other cancers, leukemia isn’t transferable and can’t be approved on to other
people. There is integer of factors that may amplify a person’s risk of budding leukemia.
Having a scrupulous hazard factor doesn’t denote you will definitely get this category of
disease and personnel lacking any recognized risk factors can still develop it.

2.1 Risk factors :


The recognized risk factor of generating this type of cancer i.e. leukemia are clarified :

1. Exposure to radiation: People who exposed to high level of release, such as


nuclear developed accidents, have the main risk of developing leukemia than
people who have not been exposed. On the other hand, a small numeral of people

DEPT OF ECE 11 KHIT


Leukemia detection using image processing by matlab

in the UK will be uncovered to emission levels high adequate to augment their


risk.

2. Smoking: Smoking increases the risk of initial leukemia. This may be due to the
intense levels of benzene in cigarette smoke.

3. Exposure to benzene: In very unusual cases, leukemia may begin due to the
long term contact to benzene (and possibly other solvents) used in industry.

4. Cancer treatments: Now and then, a few anti-cancer treatments such as


chemotherapy or radiotherapy can be a basis for leukemia to build up after some
years of this behaviour. The risk increase when persuaded types of chemotherapy
drugs are mutual with radiotherapy. While leukemia develops since of earlier anti-
cancer treatment, this is called lower leukemia or treatment related leukemia.

5. Blood disorders: People with certain blood disorders, such as myelodysplasia or


myeloproliferative disorderhave a distended risk of initial AML.

6. Genetic disorders: People with a certain hereditary disorder, excluding Down’s


syndrome and Franconia’s anaemia, have an inflated risk of embryonic leukemia.
From all leukemia types as discussed above, the symptoms are generally caused
by the normal blood cells lacking as compare to the abnormal white cells
presence.

Figure 8 :- child after vs before leukemia

DEPT OF ECE 12 KHIT


Leukemia detection using image processing by matlab

Because of more number of leukemia cells in the bone marrow, it become unable
to occur more number of blood cells that are needed by the body.
The symptoms of leukemia are :

1. Poor blood clotting.


2. Affected immune system.
3. Anaemia.
4. Patients might also feel nausea, fever, chills, night sweats, flu-like symptoms,weight
loss, bone pain, and tiredness.
5. If the liver/spleen grows unnecessarily the patient might feel full and will eat less,
following in weight loss.
6. Weight loss could also occur independently of hepatomegaly (enlarged liver) or
splenomegaly (enlarged spleen).

A headache is more popular among patients whose harmful cells have invaded the
central nervous system (CNS).As all these signs could be due to other diseases, a
diagnosis of leukemia could only be verified after medical tests are conducted out.

In order to improve patient diagnosis, various image processing software are


developed to extract useful information from medical images. An essential part of the
diagnosis and treatment of leukaemia is the visual examination of the patient’s peripheral
blood smear under the microscope. Morphological changes in the white blood cells are
commonly used to determine the nature of the malignant cells, namely blasts.
Morphological analysis of blood slides are influenced by factors such as haematologists
experience and tiredness, resulting in non-standardized reports.

So, there is always a need for a cost effective and robust automated system for
leukaemia screening which can greatly improve the output without being influenced by
operator fatigue. Earlier various methods have been introduced as studied in literature
review but these techniques have not provided good accuracy with less error rate.

DEPT OF ECE 13 KHIT


Leukemia detection using image processing by matlab

So, to enhance the detection rate there is urgent need to develop that type of
algorithm that will provide high accuracy with less error rate. So, this research work has
presented an application for disease detection based on leukaemia cells. The work has used
GA (Genetic algorithm) for feature extraction and the classification of cells for the
recognition as well as the normal cells differentiation from the blast cell.

2.2 Symptoms of leukemia :

1. Excessive sweating at night.


2. Fatigue.
3. Weight loss.
4. Bone pain and tenderness.
5. Swollen lymph nodes.
6. Enlargements of the liver or spleens.
7. Fever frequent infections.

But so, to design an algorithm an make it to an application, First we need to


understand some of the importants factors about blood cells.

1. How cells are useful to body.


2. What the function of cells inside body.
3. How the cells are actually created
4. Whats the relation between blood cells and bone marrow
5. How we differ the cancer cells and myeloid and lympoids.
To get to know all about these questions, we need to study the Bone anatomy and
The
Formation of Myeloid and Lymphoid Series of Cell.
This study helps us to knowledge that how the luekemia is formed in the cells and
abnormalities in the function of cells.

DEPT OF ECE 14 KHIT


Leukemia detection using image processing by matlab

Figure 9 :- Bone Anatomy

Leukemia that starts in the tissue that forms blood. To understand the concept of
cancer, it helps to know how normal blood cells form. Normal Blood Cells develop from
of cells in the bone marrow called Stem cells. Stem cells classify into different kinds of
blood cells.

DEPT OF ECE 15 KHIT


Leukemia detection using image processing by matlab

Figure 10 :- 1.White blood cell 2. Red blood cell 3. Platelets

1. White blood cells help to fight infection in the human body. There are several
types of white blood cells shown in figure.

2. Red blood cells use for carrying oxygen to tissues throughout the human body
shown in figure.

3. Platelets help to blood clots that control bleeding in the human body shown in
figure.

Above white blood cells, red blood cells, and platelets are use for made stem cells
as the human body needs them.

DEPT OF ECE 16 KHIT


Leukemia detection using image processing by matlab

When blood cells grows old or to get damaged, they die, and body produce new
cells take their place.

Below Figure shows how stem cells can be mature into different two types of

white blood cells. First myeloid stem cell and second lymphoid stem cell:

Figure 11 :- The Formation of Myeloid and Lymphoid Series of Cell

A myeloid stem cell converts into a myeloid blast. The blast can be form a red
blood cell, platelets, or one of the several types of white blood cells.

A lymphoid stem cell converts into a lymphoid blast. The blast can form one of the
several types of white blood cells, such as B white blood cells or T white blood cells.
Both the white blood cells that form from myeloid blasts are different from the white
blood cells that form from lymphoid blasts.

DEPT OF ECE 17 KHIT


Leukemia detection using image processing by matlab

CHAPTER - 3
LITERATURE SURVEY

DEPT OF ECE 18 KHIT


Leukemia detection using image processing by matlab

Survival rates vary substantially by leukemia type, ranging from a 5-year relative
survival of 25% for patients diagnosed with AML to 82% for those with CLL. Advances
in treatment have resulted in a dramatic improvement in survival over the past three
decades for most types of leukemia. For example, from 1975-1977 to 2002-2008, the 5-
year relative survival rate for ALL increased from 41% to 68% overall, and from 58% to
91% among children.

In large part due to the discovery of targeted cancer drugs like Imatinib, the 5-year
survival rate for CML increased from 31% for cases diagnosed during 1990-1992 to 56%
for those diagnosed during 2002-2008. Acute Lymphocytic Leukemia (ALL), also known
as acute lymphoblastic leukemia is a cancer of the white blood cells, characterized by the
overproduction and continuous multiplication of malignant and immature white blood cells
(referred to as lymphoblast or blasts) in the bone marrow.

It is fatal if left untreated due to its rapid spread into the bloodstream and other
vital organs which will effect the human body by effecting human blood cellsThere are
many types of cancer. Cells in any part of the body can become cancerous
when cells in the body begin to grow uncontrolled. Leukemia is cancer that starts in blood
cells.Leukemia is divided based on whether the leukemia is acute (fast-growing) or chronic
(slower-growing), and whether it starts with myeloid cells or lymphoid cells.

Acute lymphocytic leukemia (ALL) is a cancer of the blood and bone marrow.
Acute lymphocytic leukemia (ALL) is also called acute lymphoblastic leukemia. “Acute”
means that leukemia can progress quickly and creates immature blood cells, rather than
mature ones and if not treated, would probably be fatal within a few months.

"Lymphocytic" means it develops from early (immature) forms of lymphocytes, a


type of white blood cell (WBC). Acute lymphocytic leukemia is a common form of cancer
in children, and treatments result in a good chance for a cure, whereas in adults, treatment
is greatly reduced. However, if left untreated, acute lymphocytic leukemia is eventually

DEPT OF ECE 19 KHIT


Leukemia detection using image processing by matlab

fatal; it will spread to the lymph nodes, spleen, liver, central nervous system, and other
organs.

Acute lymphocytic leukemia occurs when a bone marrow cell develops errors in its
deoxyribonucleic acid (DNA). The errors tell the cell to continue growing and dividing,
while a healthy cell would stop growing and dividing and eventually die. When this
happens, blood cell production becomes abnormal. The bone marrow produces immature
cells that develop into leukemic white blood cells called lymphoblasts.

These abnormal cells are unable to function properly, and they can build up and
crowd out healthy cells. It is not clear what causes the DNA mutations that can lead to
acute lymphocytic leukemia.

The symptoms of leukemia include fatigue, unexplained fever, abnormal bruising,


headaches, excessive bleeding (such as frequent nosebleeds), unintentional weight loss,
and frequent infections, to name a few.

There are around 60,000 new cases of leukemia each year in the U.S. and over
24,000 deaths due to leukemia. Leukemia makes up about 3.7% of all new cancer cases.
Acute lymphocytic leukemia is the most common type of leukemia in children, but it can
also affect adults. In this type of leukemia, immature lymphoid cells grow rapidly in the
blood.
It affects almost 6,000 people per year in the U.S. In addition, the cost of leukemia
treatment can be overwhelming. The average total cost of inpatient ALL treatment
(induction phase) is $31,694 for both adults and children.

The cost of consolidation therapy is $29,244 and $12,753 in adults and children,
respectively. The maintenance therapy cost is $7,288 and $3,452 in adults and children,
respectively. The high-risk therapy following relapse is $17,100 an $12,000 in adults and
children, respectively.

DEPT OF ECE 20 KHIT


Leukemia detection using image processing by matlab

The total treatment cost for ALL is estimated at $85,326 for adults and $59,899 for
children. In general, about 40 percent of adults with ALL are considered cured at some
point during their treatment, estimates the American Cancer Society.

According to the National Cancer Institute (NCI), the five-year survival rate for
American children with ALL is around 85 percent. This means that 85 percent of
Americans with childhood ALL live at least five years after they receive a cancer diagnosis.
The NCI states that among American children with ALL, an estimated 98 percent achieved
remission.

Remission means a child does not have any signs or symptoms of the condition and
blood cell counts are within normal limits. A number of factors can affect a person’s
survival rate following an ALL diagnosis, such as a person’s age or WBC count at the time
of diagnosis.

The early and fast identification of the leukemia aids in providing the appropriate
treatment. Therefore, image processing techniques can decrease the cost of treatment by
fast and parallel diagnosis in the early stages of the disease. Image processing techniques
can assist pathologists to have a more accurate diagnosis by improving the clarity of
concerned features in WBC images.

The classification of blood cells is important for the evaluation and diagnosis of
many diseases in medical diagnosis systems. WBC reveals diagnostic information about
different diseases like Leukemia, Malaria, Multiple Myeloma, dengue fever, etc.

Blood is the circulating fluid in the body composed of Leucocytes or White Blood
cells (WBC), Erythrocytes or Red Blood Cells (RBC) and Platelets. The Erythrocytes and
Leukocytes are differentiated from the fact that WBC’s has a nucleus in the middle while
RBC’s have no nucleus.

DEPT OF ECE 21 KHIT


Leukemia detection using image processing by matlab

Detection of ALL can be done through the analysis of white blood cells (WBCs).
Microscopic pictures are reviewed visually by hematologists and the procedure depends
on the skill of the operator, is tedious, time taking and have numerous drawbacks, such as
slow analysis and a non-standard accuracy, which causes late detection.

Recently, computerized methods for cancer detection have been explored towards
minimizing human intervention and providing accurate clinical information. This paper
focuses on a computer-based system for automated detection of Acute Lymphocytic
Leukemia based on image processing algorithms for the classification of blood cells as an
assistive diagnostic tool for pathologists. The proposed strategy is effectively connected to
many numbers of the picture, demonstrating accurate results for distinctive picture
handling calculations, for example, Clustering, Mathematical process, and Labeling are
executed utilizing MAT.

Survival rates vary substantially by leukemia type, ranging from a 5-year relative
survival of 25% for patients diagnosed with AML to 82% for those with CLL. Advances
in treatment have resulted in a dramatic improvement in survival over the past three
decades for most types of leukemia.

For example, from 1975-1977 to 2002-2008, the 5-year relative survival rate for
ALL increased from 41% to 68% overall, and from 58% to 91% among children. In large
part due to the discovery of targeted cancer drugs like Imatinib, the 5-year survival rate for
CML increased from 31% for cases diagnosed during 1990-1992 to 56% for those
diagnosed during 2002-2008.

Acute Lymphocytic Leukemia (ALL), also known as acute lymphoblastic


leukemia is a cancer of the white blood cells, characterized by the overproduction and
continuous multiplication of malignant and immature white blood cells (referred to as
lymphoblast or blasts) in the bone marrow. It is fatal if left untreated due to its rapid pread
into the bloodstream and other vital organs which will effect the human body by effecting
human blood cells rapidly and slowly based on cancer type.

DEPT OF ECE 22 KHIT


Leukemia detection using image processing by matlab

CHAPTER- 4
EXISTING SYSTEM

DEPT OF ECE 23 KHIT


Leukemia detection using image processing by matlab

Leukemia has many different types. Some forms of acute leukemia are fast
growing, while other chronic forms of the disease may require less aggressive treatments.
A thorough and accurate cancer diagnosis is a critical first step in developing a leukemia
treatment plan. Our multidisciplinary team of leukemia experts uses a variety of tools and
technologies designed for diagnosing leukemia and developing a treatment plan tailored to
each patient’s needs. Throughout your treatment, we'll use imaging and laboratory tests to
monitor your response to treatment and modify your plan when needed.

4.1 Different methods to diagnosis the leukemia :


Diagnostic tests used for diagnosing leukemia : Doctors may find chronic leukemia
in a routine blood test, before symptoms begin. If this happens,or if you have signs or
symptoms that suggest leukemia, you may undergo the following diagnostic exams:

• Physical exam :Your doctor will look for physical signs of leukemia, such as pale skin
from anemia, swelling of your lymph nodes, and enlargement of your liver and spleen.

• Blood tests : By looking at a sample of your blood, your doctor can determine if you
have abnormal levels of red or white blood cells or platelets — which may suggest
leukemia. A blood test may also show the presence of leukemia cells, though not all
types of leukemia cause the leukemia cells to circulate in the blood. Sometimes the
leukemia cells stay in the bone marrow.

• Bone marrow test : Your doctor may recommend a procedure to remove a sample of
bone marrow from your hipbone. The bone marrow is removed using a long, thin
needle. The sample is sent to a laboratory to look for leukemia cells. Specialized tests
of your leukemia cells may reveal certain characteristics that are used to determine your
treatment options.

DEPT OF ECE 24 KHIT


Leukemia detection using image processing by matlab

Figure 12 :- Extraction of sample of bone marrow from your hipbone

• Biopsy: A biopsy is used to determine the type of leukemia, the growth rate of the
tumor, and whether the disease has spread. Common biopsy procedures for leukemia
include:

1. Bone marrow biopsy removes a sample of bone marrow.


2. Lymph node biopsy removes all or part of a lymph node.

• Imaging tests: These procedures may provide information about the extent of
leukemia in the body, and the presence of infections or other problems. The following
imaging tests may be used to help formulate a leukemia diagnosis.

DEPT OF ECE 25 KHIT


Leukemia detection using image processing by matlab

• Lab tests: These tests measure the amount of red blood cells, white blood cells and
platelets in the blood, which are often lower than normal when leukemia has developed.

1. X-ray
2. CT scan
3. PET/CT scan
4. MRI
5. Ultrasound
6. 2D echocardiogram
7. Pulmonary function test

• Lumbar puncture: Also known as a spinal tap, this test may be required to
determine the extent of leukemia. Lumbar punctures may also be used to inject
medications, such as chemotherapy drugs, to treat the disease.

Disadvantages of the traditional ways of diagnosis :

• The clinical behavior of the disease can be predicted using this classification and
accordingly treatment should be given to the patient. In leukemia disease, large
numbers of abnormal white blood cells are produced by bone marrow due to
unknown cause.

• In pathology manual detection of leukemia is done which is time consuming as


well as costly due to high cost pathology instruments.

To Overcome this Hence automatic technique is adopted for fast and accurate
results. In this technique image of blood sample is processed and nucleus part is
segmented and finally cells are classified whether they are blast or normal one.

DEPT OF ECE 26 KHIT


Leukemia detection using image processing by matlab

4.2 Complications of leukemia :

Many of the challenges of leukemia relate to the depletion of normal blood cells as
well as the side effects of treatments as described in the previous section, such as
frequent infections, bleeding, and GVHD in recipients of stem cell transplants. Weight
loss and anemia are further complications of leukemia and its treatment. Complications
of any leukemia also include a relapse or a progression of the disease after a remission
has been achieved with treatment.

Other complications of leukemia relate to the specific type of leukemia. For


example, in 3% to 5% of cases of CLL, the cells change characteristics and transform
into an aggressive lymphoma. This is known as a Richter transformation. Autoimmune
hemolytic anemic, in the body attacks and destroys red blood cells, is another potential
complication of CLL. People with CLL are also more likely to develop second cancers
and other blood disorders and blood cancers.

Tumor lysis syndrome is a condition caused by the rapid death of cancer cells
during acute treatment. It can occur in almost any type of cancer, and it is seen with
some cases of leukemia, particularly when large numbers of leukemia cells are present
such as with AML or ALL. The rapid destruction of the leukemia cells leads to the
release of large amounts of phosphate, which further causes metabolic abnormalities
and can lead to kidney failure.

Children who receive therapy for ALL may experience late adverse effects
including central nervous system (CNS) impairment, slowing of growth,
infertility, cataracts, and an increased risk for other cancers. The incidence of these
late effects varies depending upon the age at treatment and the type and strength of
therapies.

DEPT OF ECE 27 KHIT


Leukemia detection using image processing by matlab

4.3 Prognosis of leukemia :

The prognosis of leukemia depends upon the type of leukemia that is present and
the age and health status of the patient. Mortality (death) rates for leukemia are higher
in the elderly than in younger adults and children. In many cases, leukemia can be
managed or cured with treatments available today. In particular, childhood ALL has a
very high 5-year survival rate.

Modern treatments have led to a greater than fourfold increase since 1960 in five-
year survival rates for leukemia. Five-year survival rates for different types of
leukemia from 2007-2013 are approximately:

• CML: 68%
• CLL: 86%
• AML: 27% overall, 66% for children and teens younger than 15
• ALL: 71% overall, over 90% for children.

DEPT OF ECE 28 KHIT


Leukemia detection using image processing by matlab

CHAPTER 5

PROPOSED SYSTEM

DEPT OF ECE 29 KHIT


Leukemia detection using image processing by matlab

The proposed approach provides an excellent response to reduce the time


consumption to find blood leukemia and white blood cancer in earlier stages. In this work,
image processing technology is used for the early detection of blood cancer in the treatment
of blood cancer disorders by using MATLAB.

It has proposed a methodology is evaluating blood cancer by using Adaptive


Filtering to preprocess the image to remove the noise and multi-module sub clustering used
to segment the filtering image. In this proposed, Recognition classification algorithm for
blood cancer detection using microscopic images. Since it is Multi-module sub-cluster
segmentation will advanced extract the blood cancer disorders.

Then mainly have analyzed the disease patterns in the cell region to detect blood
cancer. The proposed method comprises of mainly four steps: pre-processing, ROI (Region
Of Interest) segmentation, feature extraction, and classification. Filter technology is the
fundamental basis for identifying image changes that are pre-processing and segmentation
specific. In this module, the detection of blood cells is performed in the image processing
procedures are represented.

This approach is very important as it greatly reduces the manual and semi-
automatic processing of multi-scale segmentation, improves multi-mode subclusters, and
learns more samples. The proposed method of white blood cell cancer prediction process
block involves input image, preprocessing, segmentation is showing above figure 2.Gray
and white segmentation feature extraction data, showing the potential of this GFCVR
predict the disease of white blood cancer disease. We demonstrate such image processing
and deep learning in combination with automatic image segmentation tissues have great
potential blood cancer disease classification results.

The output of this method provides us with a specific area of our initial sample in

DEPT OF ECE 30 KHIT


Leukemia detection using image processing by matlab

which we presume that the malignant cell resides. This is done by observing the cell
boundary closely to observe its shape. If the shape coincides with any geometric feature
(circular, oval, etc) we deduce that the cell is not infectious. On the other hand, if the cell
boundary doesn’t coincide with any geometric figure, it may be inferred that the cell is
malignant and the patient requires immediate treatment.

5.1 METHODOLOGY :

The main objective of this study is to design and develop an image processing system
for blood cells counting. Normally,the number of white blood cell in patients with positive
cases of leukemia will increase. The increasing number of white blood cell will increase
the ratio of white blood cell (WBC) to red blood cell (RBC). Thus, it is important to have
costeffective image processing system which will assist haematologists to determine the
ratio of white blood cells to red blood cells for leukemia detection. The methodology used
to develop the image processing system is described in the following.

1. Image Acquisation.

2. Image Pre-processing.

3. Image Enhancement.

4. Image Segmentation.

5. Colour Segmentation.

6. Feature Extraction.

7. Detection and Counting

DEPT OF ECE 31 KHIT


Leukemia detection using image processing by matlab

FLOW CHARTS FOR THE PROCESS OF DETECTION OF LEUKEMIA


USING IMAGE PROCESSING BY MATLAB

DEPT OF ECE 32 KHIT


Leukemia detection using image processing by matlab

Figure 13 :- FLOW CHART - 1

Figure 14 :- FLOW CHART - 2

DEPT OF ECE 33 KHIT


Leukemia detection using image processing by matlab

BLOCK DIAGRAM OF LEUKEMIA DETECTION


BY IMAGE PROCESSING

Image Image pre- Image


acquisition processing segmentation

Cell Feature COLOUR


counting extraction SEGMENTATION

Calculation
and result

Figure 15 :- Block diagram

DEPT OF ECE 34 KHIT


Leukemia detection using image processing by matlab

5.2 Process Explanation :

1. Image Acquisition: The first step in the process is image acquisition i.e., to acquire a
digital image from Microscopic equipment with effective magnification.

It requires an image sensor and the capability to digitize the signal produced by the
sensor. Figure shows the acquired blood cell image for further processing and analysis
at a resolution i.e; adjusted respective for the detectable quality ( Standard resolution
is 200 x 300 ).

Figure 16 :- Blood smear image

2. Image Pre-processing: After the digital image has been obtained, the next step deals
with pre-processing of that image. In the acquired image, the color of the entire blood
element and the background color appear to be similar. Further RBC and WBC are
grouped with blood platelets in the presence of noise and stain in blood slides. Hence
preprocessing helps to overcome or reduce noise in the image. The gray level
intensity of WBC is darker compared to the RBC. The blood plasma and dust
particles in blood smear image are cleaned by removing all other blood particles.
Figure, shows contrast stretching on blood cell image

To change the contrast or brightness of an image, the adjust contrast tool performs
contrast stretching. In this process, pixel values below a specified threshold value are

DEPT OF ECE 35 KHIT


Leukemia detection using image processing by matlab

displayed as black, pixel values above a specified value are displayed as white, and
pixel values in between these two values are displayed as shades of gray. The result is
a linear mapping of a subset of pixel values to the entire range of grays, from black to
white, producing an image of higher contrast.

Original blood cells images are in color. After contrast stretching, the image is
converted into Grayscale image. Grayscale represents the intensity of the image, while
converting to grayscale image to ease the process of ratio determination so the contrast
image converted into grayscale image. Grayscale image by eliminating the hue and
saturation information while retaining the luminance. The gray level intensity in WBC
is darker when compared to the RBC. In blood smear image are cleaned by removing
other object such as plasma and blood particles. Figure 3.3 shows Grayscale image.

Figure 17(a) : Contrast Stretching Figure 17(b) :Gray-Scale image


Figure 17 :- image preprocessing

3. Image Enhancement :

After pre-processing, image enhancement is done. Image enhancement operations


improve the quality of an image. They can be used to improve image’s contrast
intensification and brightness characteristics, reduce its noise cleaning or smoothing,
content or sharpen and edge sharpening or crispening its details. Various image
enhancement techniques are median filtering, wiener filtering, image negation,
histogram plotting and image subtraction.

DEPT OF ECE 36 KHIT


Leukemia detection using image processing by matlab

Median Filtering :

Median filtering is more effective in image smoothening and preserve edges while
removing noise. In this proposed work, median filtering techniques has been applying
using the formula

v (m, n) = median {y (m –k, n-1), (k, 1) € W} (1)

Where W is a suitably chosen window. The algorithm for median filtering


requires arranging the pixel values in the window in increasing or decreasing order and
picking the middle value. Nw is even, then the median is taken as the average of the
two values in the middle. Nw is odd, specify the window size. 2D median filtering
example using a 3*3 sampling window:

order values not changed

DEPT OF ECE 37 KHIT


Leukemia detection using image processing by matlab

Steps for 2D-median filtering:


a. construct a window of size [m , n]

b. sort the values in the window

c. find the median value

d. keep the border values unchanged

e. replace the remaining values in the window with median value

f. slide the window

Figure 18 :- Shows the image enhancement after applied median filtering.

4. Image segmentation :

Image Segmentation partitions an input image into its constituent parts or objects.
Various techniques used for segmentation are histogram, K-means clustering, Gram-
Schmidt orthogonalization and snake algorithm. Different segmentation techniques are
used by individual authors such as, combination of the watershed technique and a
parametric deformable model, Hough transform techniques and so on. These methods are
more complex and require more processing time in comparison with other methods. The
advantage of this method is to provide more accurate result for segmentation.

Jianhua et al. identified the cell segmentation for blood, edge detection performs poorly
on cell images because not all boundaries are sharp and it is difficult to get all edge
DEPT OF ECE 38 KHIT
Leukemia detection using image processing by matlab

information and locate cells accurately. So, they developed an iterative Otsu’s approach
based on circular histogram for the leukocyte segmentation. Dwi Anoragaingrum has
proposed cell segmenting using median filtering and morphological operations are used. In
this proposed work different techniques are used for segmentation i.e. segmentation using
gradient magnitude. After applying gradient magnitude the segmentation and edge
detection based on sobel operator. The borders of white blood cells are enhanced. The
gradient is high at the borders of the objects and low (mostly) inside the objects. The
unsharp masking technique is used to crispen the edges. A signal proportional to the
unsharp or low-pass filtered, version of the image is subtracted from the gray image. This
is equivalent to adding the gradient, or a high-pass signal, to the image. After applying
gradient magnitude, marker controlled watershed algorithm is used to avoid over
segmentation issue. When the operation of masking is applied, the masked image has
diminished the red blood cells.
Unsharp masking operation can be represented as,

V (m, n) = u (m, n) + gλ (m, n)

Where λ>0 and g(m, n) is a suitably defined gradient magnitude at (m, n). Figure
shows the Gradient Magnitude result obtained after applying segmentation algorithm.

Figure 19 :- Gradient Magnitude

DEPT OF ECE 39 KHIT


Leukemia detection using image processing by matlab

5. Morphological operations :

A morphological operation helps to detect exact shape of object. The data should
be represented as a boundary or as a complete region. It refers to certain operations
where an object is hit with a structuring element and thereby reduced to more revealing
shape. To create a structuring element specified by a shapes structures like disk, disk-
shaped approximation are suitable for computing cells. Disk-Shaped structuring
element is approximated by specified radius from the origin of cells. Morphological
operation includes erosion, dilation, filtering, and granulometry. In this proposed work
morphological erosion and dilation had been applied to this image to eliminate small
unwanted pixel and image smoothing. The erosion operation uniformly reduces the size
of objects in relation to their background and dilation expands the size of objects.
Besides dilation and erosion International Journal of Computational Intelligence
and Informatics, Vol. 5: No. 2, September 2015. Besides dilation and erosion
secondary operations like opening (erosion followed by dilation) and closing (dilation
followed by erosion) can be applied on the image. Opening used to smooth the contours
of cells and parasites; and closing used to fill the holes and gaps.

Figure shows the results obtained after a series of morphological operations


namely erosion and dilation. It is eliminate small unwanted pixel and for image
smoothening. Perform the morphological area closing on the lower pixel image to fill
the hole and the unwanted small pixels are eliminated. The dilation and area closing
have been applied on higher pixel image.

DEPT OF ECE 40 KHIT


Leukemia detection using image processing by matlab

Figure 20(a) :- Opening Figure 20(b) :- Erosion

Figures shows the area closing on the lower pixel image and higher pixel image
using after morphological operation involving erosion and dilation, the WBC can be
viewed accordingly.

Figure 20(c) :- Closing Figure 20(d) :- Dilation

Figure 20 :- Morphological Process

6. Segmentation:
Segmentation of white blood cell and determination of ROI, which is nucleus for
white blood cell only. This is done because in leukemia cell images, the cytoplasm is
scanty. So, focus will be on nucleus of white blood cell only. Determination the types of
white blood cell should be done from the nucleus. Only lymphocytes and myelocytes
should be considered and need to determine them whether they are blast cells or not. Once

DEPT OF ECE 41 KHIT


Leukemia detection using image processing by matlab

the blast cells are determined, and then proceed to the next step. Sub images containing
nucleus only will be considered. This is to reduce errors since there are similar color scales
in white blood cells with other blood particles.To segment the desired WBC object from
the background it is found that the red component of the RGB input image gives the best
contrast between the background and the blood cells components including WBC, RBC
and platelets as shown in Figure.

However, when the blue channel is used, WBC fades out while with the green channel
the WBC cytoplasm color is close to the RBCs color. In order to produce a representative
binary image, Otsu’s adaptive thresholding algorithm (Otsu, 1979) is then applied on the
red channel. Watershed distance transform process is applied on the binary image obtained
by Otsu’s thresholding.

Figure 21 :- Red channel image after applying Segmentation

Using watershed on blood slides, different objects (including WBC, RBC, platelets and
stain), are extracted from the original image. Fig.4 shows the results of the watershed
algorithm when applied on the image. As it can be seen, a considerably large number of
segments are achieved while the image has only one WBC.

At this stage a decision has to be made in order to figure out which masks, of the many
obtained from watershed, represent WBC. Each area obtained with the watershed was
singled out by masking it with the original image. Furthermore, a bounding box, to reduce
the background part and better prepare the segment object for further processing, is
created. The first stage of WBC classification is based on the area of the bounding box
representing each element obtained from watershed stage.

DEPT OF ECE 42 KHIT


Leukemia detection using image processing by matlab

Since WBC has distinctive area size when compared with other elements a threshold
value is obtained, using trial and error, below which a segment is rolled out of being a
WBC.

Figure 22 :- Watershed output of the image


7. Feature Extraction :

The most important problem in generation of features of blood cells is to characterize


them in a way enabling the recognition of different blast types with the highest accuracy.
The features to be extracted from nucleus are geometrical features like area, radius,
perimeter, symmetry, concavity, compactness, solidity, eccentricity, elongation, form
factor, Texture Features which includes homogeneity, energy, correlation, entropy,
contrast, angular second momentum, Color Features like mean color values, Statistical
Features like mean value, variance, skew-ness, kurtosis of the histograms of the image
matrix and the gradient matrix for RGB or HSV or L*a*b color space (whichever
appropriate) . In, eight shape features are extracted from the nucleus of WBC and a ratio
between the area of nucleus and cytoplasm is also taken into account. Shape features are
area, perimeter, compactness, eccentricity, orientation, solidity, form factor and roundness.
General shape features are extracted using the standard procedure present in the MATLAB
Image Processing Toolbox (7.6). Form-factor and Roundness are calculated as follows,

DEPT OF ECE 43 KHIT


Leukemia detection using image processing by matlab

To demonstrate the initial application of the automatic nucleus-segmented images,


calculated the area of nucleus in each image to be the feature to the Bayes classifier. Fabio
extracted features regarding the gray-level intensity pattern of the image (i.e., granularity
of the color, uniformity), morphological features such as the perimeter, the area, the
momentums of the image, etc.

Recognition of the blood cell on the basis of its image needs generation of the
numerical features well describing the differences of images belonging to different classes.
In characterizing the images by the numerical values, get the features strictly
corresponding to these on the basis of which the human expert makes his diagnosis, that is
the geometry of cell, texture, color and intensity of the image associated with different cell
types. Four families of features have been created in this way.

The geometrical features include such parameters as radius, perimeter, area, the area
of convex part of the cell, compactness, concavity, symmetry, major and minor axis
lengths, etc.

These parameters are determined only for the nucleus of the cell. The texture refers to
an arrangement of the basic constituents of the material and in the digital image is depicted
by the interrelationships between spatial arrangements of the image pixels. Up to 105
texture features have been generated for the cell image at normal and reduced resolutions.
The next set of features has been generated from the analysis of the intensity distribution
of the image.

DEPT OF ECE 44 KHIT


Leukemia detection using image processing by matlab

The histograms of the image and gradient matrix of such intensity have been
determined for R, G, B components of the image. On the basis of such analysis, generated
features like mean and variance of the histogram of the image of nucleus and cytoplasm
(separately) as well as for the gradient matrix of the image, the skew-ness and kurtosis of
the image of the whole cell as well as for the gradient matrix of the whole cell. Up to 24
statistical features have been generated in this way for two colors (red and green). The last
set of features is related to the morphological operations performed on the image (erosion,
dilation, opening and closing). These parameters include the area and number of separated
objects of the image after application of some morphological operations. Up to 16
morphological parameters have been generated in this way. All features have been
normalized, dividing their original values by the corresponding maxima.

DEPT OF ECE 45 KHIT


Leukemia detection using image processing by matlab

CHAPTER – 6
TYPES OF SEGMENTATION PROCESS

DEPT OF ECE 46 KHIT


Leukemia detection using image processing by matlab

The main important step in the leukemia detection is segmentation process and this is
the principal approach used in this category. the region-based segmentation approaches in
the second category are based on partitioning an image into regions that are similar
according to the predefined criteria. Color Image Processing: Adding color to gray scale
image so as to improve description of the image and better human perception.and this is
the next step continued after the image pre-processing.
There are 3 methods to perform the segmentation process. They are :

1.Watershed transform.
2.K Means Clustering Technique.
3.Histogram Equalization and Linear Contrast Stretching.

6.1 Watershed transform :

Lim Huey Nee et al. proposed methods for segmentation of white cells based on
morphological operation, gradient magnitude and watershed transform. First image
acquisition techniques is used then segmentation is done to separate the blast cell and back
ground. For this method, first the RGB image is converted into HSV color model and
saturated component is extracted for further processing and then find the gradient
magnitude for the saturation component. This is used for edge detection. Moreover, sobel,
canny, prewitt operators are used for the edge detection. After extracting the white cells
from the image and elimination of the background and red cells, dilation or erosion process
is carried out. Then watershed transform is carried out to separate the connected cell. Thus,
leukemic cell can be identified and this method gives very accurate result. But the exact
separation of cells cannot be done using this method. The process flow and block diagram
is shown in respective figure.

DEPT OF ECE 47 KHIT


Leukemia detection using image processing by matlab

Figure 23 :- Block Diagram of Watershed Transform

DEPT OF ECE 48 KHIT


Leukemia detection using image processing by matlab

Figure 24(a):- Original Image Figure 24(b)- :RGB to HSV color model

Figure 24(c):- Saturation component Figure 24(d):- Derivation of gradient magnitude

Figure 24(e):- Area opening Figure 24(f):- Opening-Closing

Figure 24(g):- Detect white cell using Figure 24(h):- Detection of white cell super imposed
colored watershed label matrix transparency on original image

Figure 24 :- Process of watershed method

DEPT OF ECE 49 KHIT


Leukemia detection using image processing by matlab

Pre-Processing: Image pre-processing is a technique by means of which


signal to noise ratio and image quality can be improved that will be helpful
in further processing.
The functions performed by
preprocessing are listed Below
• Gray scale conversion

• Contrast Enhancement
Conversion to Gray Scale:
A grayscale image is supposed to contain only „Gray‟ color where the
red, green and blue color components are said to have same intensity values
and so processing becomes flexible when we specify only a single intensity
value for each pixel, instead of taking three intensity values needed to be
specified for each pixel in a color image. Microscopic images are found to
possess the primary colors (RGB).

Gradient Magnitude Formation:

Gradient depicts characteristics relating to the property of an object.


By means of using the Sobel edge masks, imfilter and some simple arithmetic
operation the gradient magnitude is formed. The gradient will be high at the
borders of the objects and low inside the objects as in Fig. 8. Watershed
Transform: The term watershed refers to a ridge that divides areas based on
different pixel intensities. By employing watershed transform the gradient
image is converted into RGB image with unique labeling based on intensity
values.

DEPT OF ECE 50 KHIT


Leukemia detection using image processing by matlab

6.2 K Means Clustering Technique :

To identify the abnormalities in blood cells or to identify the lymphoblast, the


method of clustering techniques is used. After pre-processing of image feature
extraction is done that gives useful information about image.

The pre-processing techniques are only used for image enhancement. It does not give

any necessary information of image. So initially acquisition process is done and then

contrast enhancement is necessary to see clear image.

After that RGB image is converted to HSI color model and then K-means clustering

technique is applied for segmentation. Median filter is used to remove the noise from

image. After feature extraction, image is classified by clustering techniques. Feature

extraction is used to identify the white cells or the lymphoblast from image. And they

extract the desired or same type of cells by differing them with some of the features

which includes area, radius, perimeter, symmetry, concavity, compactness, solidity,

eccentricity, elongation, form factor will be obtained.

Texture Features - which includes homogeneity, energy, correlation, entropy, contrast

and angular second momentum will be obtained. Color Features – the red, green and

blue color spaces will be transformed into Green color spaces. Their mean color

values will be obtained

DEPT OF ECE 51 KHIT


Leukemia detection using image processing by matlab

Figure 25 :- Block Diagram of K-Mean Segmentation

DEPT OF ECE 52 KHIT


Leukemia detection using image processing by matlab

Figure 26(a):- Original Image Figure 26(b):- Image labeled by Cluster Index

Figure 26(c) :- Cluster of Red Cell Figure 26(d):- Cluster of white cell

Figure 26 :- process of K-Mean Segmentation

DEPT OF ECE 53 KHIT


Leukemia detection using image processing by matlab

6.3 Histogram Equalization and Linear Contrast Stretch :

To perform this operation, image is first converted from RGB to gray level and
for contrast enhancement, histogram equalization process is used. Then statistical
parameter like mean and standard deviation is calculated and erosion or dilation
technique is used for morphological operation. Here sobel operator is used to detect
the edge of cells.

Figure 27(a) :- Original Image Figure 27(b) :- RGB to gray image

Figure 27 (c):- Linear contrast Figure 27(d):- Histogram equalization image

DEPT OF ECE 54 KHIT


Leukemia detection using image processing by matlab

Figure 27(e) :- Addition of L and H

Figure 27(f) :- Subtraction of L and H

DEPT OF ECE 55 KHIT


Leukemia detection using image processing by matlab

Figure 27(g) :- Addition of e and f Figure 27(h) :- Thresholding method

Figure 27(i) :- Removal of small particle Figure 27(j) :- Edge detection by sobel opera

Figure 27 :- Process of Histogram Equalization and Linear Contrast Stretch

DEPT OF ECE 56 KHIT


Leukemia detection using image processing by matlab

Table 2 :- advantages and disadvantages of techniques

S NO ALGORITHM ADVANTAGES DISADVANTAGES


1 K –Means algorithm 1. Very simple 1. Memory intensive.
method. 2. Converges 2. Need to pick k. 3.
to a local minimum of Sensitive to
the error function. initialization, outliers.
2 Edge detection 1. Easy to understand. 1. It is not suitable for
2. Easy to implement. very noisy and
edgeless images. 2. It
is not suitable for
images whose
boundaries are very
smooth.
3 Threshold 1. Simple to 1. No guarantees of
implement. 2. Fast object coherency-
and good for some might have holes,
kinds of images. extraneous pixels.
4 Histogram It is a most effective But the color images
Equalization technique for it is a difficult task to
grayscale images. But work.
the color images
5 Image Noise It is used to reduce the While the dispensable
noise from an image image in low light.
easily.

From the above tabular formhere the algorithms ued for segmentations are Compared by
both advantages and disadvantages. Here mainly we discussedof k-mean algorithm.
From the survey carried out on the leukaemic detection, K-Means algorithm is the
algorithm which is generally used for the differentiation purpose. Many other algorithms
and image processing techniques are also used for the processing of the collected datasets.
Though after the detection is carried out by using these techniques, some drawbacks are
still faced in finding the accurate result from the data collected. Research is still carried out
on overcoming these drawbacks in order to provide an efficient and accurate result.

DEPT OF ECE 57 KHIT


Leukemia detection using image processing by matlab

CHAPTER – 7
COLOR SEGMENTATION TECHNIQUES

DEPT OF ECE 58 KHIT


Leukemia detection using image processing by matlab

There are mainly 3 techniques to extract the leukemia cells from the
given input sample.

They are :

1. RGB Technique

2. CMYK Technique

3. YCbCr Technique

Figure 28 : - Color space of RGB and CMYK along with YCbCr color space.

In segmentation process the types of blood cells will get differed but there Should
be a clarity of which cell it is , i.e; the segmentation divides the every cell from the group
of cells from the given input image of blood smear sample.
These techniques are applied to an segmented image i.e; which divided into
different cells.
This process further classify the number of cells of respective type are present and by this
we can get an idea of the blood smear sample image.

DEPT OF ECE 59 KHIT


Leukemia detection using image processing by matlab

7.1. RGB COLOR SPACE MODULE :

An RGB color space is any additive color space based on the RGB color model.
RGB color space is defined by the three chromaticities of the red, green, and blue additive
primaries, and can produce any chromaticity that is the triangle defined by those primary
colors. The complete specification of an RGB color space also requires a white point
chromaticity and a gamma correction curve. As of 2007, sRGB is by far the most used
RGB color space. RGB is an abbreviation for red green blue. RGB is a convenient color
model for computer graphics because the human visual system works in a way that is
similar – though not quite identical – to an RGB color space. The most commonly used
RGB color spaces are sRGB and Adobe RGB (which has a significantly larger gamut).
Adobe has recently developed another color space called Adobe Wide Gamut RGB, which
is even larger, in detriment to gamut density.

7.2.CMYK COLOR SPACE MODULE :

The CMYK color model (process color, four color) is a subtractive color model,
used in color printing, and is also used to describe the printing process itself. CMYK refers
to the four inks used in some color printing: cyan, magenta, yellow, and key. The CMYK
model works by partially or entirely masking colors on a lighter, usually white,
background. The ink reduces the light that would otherwise be reflected. Such a model is
called subtractive because inks "subtract" the colors red, green and blue from white light.
White light minus red leaves cyan, white light minus green leaves magenta, and white light
minus blue leaves yellow.
Figure shows the RGB and CMYK in a broad view in visible spectrum on the left
graph of color space where CMYK is clearly seemed as the base color perlative primaries
and then we have RGB in the second space where as the visible spectrum is far the next
zone concluding that the color we see is not the actual color of the subject. Coming to
YCbCr on the right side, it is the color space of digital photography and videography which
can almost display all the color.

DEPT OF ECE 60 KHIT


Leukemia detection using image processing by matlab

7.3. YCBCR COLOR SPACE MODULE :

YCbCr, also written as YCBCR or Y’CBCR, is a family of color spaces used as a part
of the color image pipeline in video and digital photography systems. Y’ is the luma
component and CB and CR are the blue-difference and red-difference chroma components.
Y’ (with prime) is distinguished from Y, which is luminance, meaning that light intensity
is nonlinearly encoded based on gamma corrected RGB primaries. Y’CbCr color spaces
are defined by a mathematical coordinate transformation from an associated RGB color
space. If the underlying RGB color space is absolute, the Y’CbCr color space is an absolute
color space as well; conversely, if the RGB space is ill-defined, so is Y’CbCr. Y’ stands
for the luma component (the brightness) and U and V are the chrominance (color)
components; luminance is denoted by Y and luma by Y’ – the prime symbols (’) denote
gamma compression, with "luminance" meaning physical linear-space brightness, while
"luma" is (nonlinear) perceptual brightness.

DEPT OF ECE 61 KHIT


Leukemia detection using image processing by matlab

CHAPTER – 8
TOOLS TO BE USED

DEPT OF ECE 62 KHIT


Leukemia detection using image processing by matlab

8.1 MATLAB :
MATLAB (matrix laboratory) is a multi-paradigm numerical computing
environment and proprietary programming language developed by MathWorks.
MATLAB allows matrix manipulations, plotting of functions and data,
implementation of algorithms, creation of user interfaces, and interfacing with
programs written in other languages, including C, C++, C#, Java, Fortran and
Python.

Although MATLAB is intended primarily for numerical computing, an


optional toolbox uses the MuPAD symbolic engine, allowing access to symbolic
computing abilities. An additional package, Simulink, adds graphical multi-
domain simulation and model-based design for dynamic and embedded systems.

8.2 GUI ON MATLAB :

MATLAB supports graphical user interface so we can involve it in


showing output of different stages.

Graphical User Interface is a medium by which the users can communicate


with the software by writing code in the editor window. For this Project the main
tool in the GUI are “Push Button”, “Static Text”, “Axes”. The push button controls
the simulation of the output which is displayed on static text and axes.

The program also include Global Variable. A Global Variable is a variable


which is recognized throughout the program. For this project our Global Variable
Would be the microscopic blood image considered as input.

DEPT OF ECE 63 KHIT


Leukemia detection using image processing by matlab

CHAPTER 9
MAJOR EXPECTED RESULTS

DEPT OF ECE 64 KHIT


Leukemia detection using image processing by matlab

9.1 Code Result :


Here we use 2 codes, one to detect the leukemia by calculating the percentages of
red blood cells and white blood cells. And other to detect the intensity of the cancer for
patient.
They detect and distinguish the different blood cells by using segmentation and techniques
(RGB,CMYK,YCBCR). In both the codes the leukemia is detected by comparing the
reference of STANDARD PERCENTAGES AND RADII of normal blood cells by the
medical associates standards.SPEED,ACCURATE & LESS COST are the main MOTO
of this methods to
detect the cancer.

9.2 Advantages :

1. The result will be accurate than comparing with the manual microscopic analysis.
2. The processing of the final result will be very speed.
3. The cost will be very less comparing with traditional diagnosis process.
4. The operating of this software can be understandable to a normal person with
5. basic computer knowledge.
6. Bringing the more awareness to the people and making this technology available
7. to every individual person who cant afford of more price for traditional diagnosis.

9.3 Disadvantages :

1. This process is in the initial stage and has some limitations which leads to some
disadvantages like :
2. The acquiring of images from microscope and enhancing the image.
3. The efficacy of the output may vary with the methods used and needs to develop
the code for further applications.
4. The system used should meet the required software and hardware needs to get the
results in expected.

DEPT OF ECE 65 KHIT


Leukemia detection using image processing by matlab

9.4 PROGRAM EXECUTION RESULT :

This is the result of code 1 used to detect potential leukemia :

Figure 29 :- Result from code -1

DEPT OF ECE 66 KHIT


Leukemia detection using image processing by matlab

Result from code – 2 to find the intensity of cancer :

Figure 30(a) :- Enhancing the image

Figure 30(b) :- Detection of red blood cells

Figure 30(c) :- Detection of cancer cells


Figure 30 :- Result from code – 2

DEPT OF ECE 67 KHIT


Leukemia detection using image processing by matlab

9.5 Final Outcome :

Figure 31 :- Result from code-1 and code - 2

Here we give the input image of blood sample and it follows the process of Block
diagram and identifies the cancer cells as shown in figure.
The code supports the formats of images like .jpg and .png formats and an Image
resolution of minimum (200 x 300) minimum. If the image of other resolution, the code
itself resize the image to respective resolution.

Figure 32 :- calculation of centres and radii of cells

DEPT OF ECE 68 KHIT


Leukemia detection using image processing by matlab

CHAPTER – 10
FUTURE SCOPE

DEPT OF ECE 69 KHIT


Leukemia detection using image processing by matlab

For further this project is developed to built a Bio-medical device to check the
cancer rapidly which includes the features SPEED,ACCURACY,LESS COST. And the
further applications of detecting all the diseases caused by blood sample can be detected
and building a Bio-medical devices.
Can detect the brain Tumours , skin cancers etc by devolpoing this technique.

The early testing of cancer can be done by using mobile phones as now a days the
mobile camera technology got well developed.
The figure shows the equipment developed to check the blood cells by the SMART
PHONE camera by applying 4X TO10X DIGITAL ZOOM.
This shows the using of daily technology to detect the deadliest cancers.

Figure 33:- cancer detection using smartphone camera

DEPT OF ECE 70 KHIT


Leukemia detection using image processing by matlab

Figure 34 :- comparison between smartphone and pathological instrument

The figure shows the zoom comparision. between SMARTPHONE camera


and LIECA DM IL LED image. Theres no much difference in between both the
image qualities and it is done by less cost by using smart phone.And it is one of the
future application of leukemia detection used.

DEPT OF ECE 71 KHIT


Leukemia detection using image processing by matlab

Code Appendix
CODE – 1 :
function varargout = LeukemiaDetection(varargin)
% LEUKEMIADETECTION MATLAB code for LeukemiaDetection.fig
% LEUKEMIADETECTION, by itself, creates a new
LEUKEMIADETECTION or raises the existing
% singleton*.
%
% H = LEUKEMIADETECTION returns the handle to a new
LEUKEMIADETECTION or the handle to
% the existing singleton*.
%
%
LEUKEMIADETECTION('CALLBACK',hObject,eventData,handles,...)
calls the local
% function named CALLBACK in LEUKEMIADETECTION.M with
the given input arguments.
%
% LEUKEMIADETECTION('Property','Value',...) creates a new
LEUKEMIADETECTION or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before LeukemiaDetection_OpeningFcn gets
called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to LeukemiaDetection_OpeningFcn via
varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows
only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help LeukemiaDetection

% Last Modified by GUIDE v2.5 16-Dec-2018 15:44:56

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @LeukemiaDetection_OpeningFcn, ...

DEPT OF ECE 72 KHIT


Leukemia detection using image processing by matlab

'gui_OutputFcn', @LeukemiaDetection_OutputFcn, ...


'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT

% --- Executes just before LeukemiaDetection is made visible.


function LeukemiaDetection_OpeningFcn(hObject, ~, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to LeukemiaDetection (see
VARARGIN)

% Choose default command line output for LeukemiaDetection


handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

% UIWAIT makes LeukemiaDetection wait for user response (see


UIRESUME)
% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = LeukemiaDetection_OutputFcn(~, ~, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure


varargout{1} = handles.output;

DEPT OF ECE 73 KHIT


Leukemia detection using image processing by matlab

% --- Executes on button press in loadImg.


function loadImg_Callback(~, ~, handles)
% hObject handle to loadImg (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(handles.exportData,'Visible','off');

[file,path] = uigetfile({'*.jpg'; '*.png'}, 'Select An Image');


if isequal(file,0)
disp('User selected Cancel');
else
selectedfile = fullfile(path,file);
%%Reading in the image
myImage = imread(selectedfile);

% call process function


cellsSegmentation(handles, myImage, "rgb");
cellsSegmentation(handles, myImage, "cmyk");
cellsSegmentation(handles, myImage, "ycbcr");

%% Show alert result


success = msgbox('Process done.','Success');

%% Show export data button


set(handles.exportData,'Visible','on');
end

% --- Executes on button press in loadCamera.


function loadCamera_Callback(~, ~, handles)
% hObject handle to loadCamera (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of loadCamera

set(handles.exportData,'Visible','off');

a = imaqhwinfo;
[camera_name, camera_id, format] = getCameraInfo(a);
global vid;
vid = videoinput(camera_name, camera_id, format);

% Set the properties of the video object


set(vid, 'FramesPerTrigger', Inf);
set(vid, 'ReturnedColorspace', 'rgb')
vid.FrameGrabInterval = 5;

DEPT OF ECE 74 KHIT


Leukemia detection using image processing by matlab

%start the video aquisition here


start(vid)

set(handles.captureImg,'Visible','on');

% Set a loop that stop after 100 frames of aquisition


axes(handles.rgb1);
while(vid.FramesAcquired<=200)
myImage = getsnapshot(vid);

%%Extracting the blue plane


bPlane = myImage(:,:,3) - 0.5*(myImage(:,:,1)) -
0.5*(myImage(:,:,2));
%%Extract out purple cells
BW = bPlane > 29;
%%Remove noise 100 pixels or less
BW2 = bwareaopen(BW, 100);

% first display the original image


imshow(myImage), hold on

%% Label connected components


[L , ~]=bwlabel(BW2);
propied=regionprops(L,'BoundingBox');
imshow(myImage);

%% Get the totalcellsRGB number of cells that have been added with
bounding box
whitecount = size(propied,1);

%% Added bounding box to the white blood cells


hold on
for n=1:whitecount

rectangle('Position',propied(n).BoundingBox,'EdgeColor','g','LineWidth',
2)
end
hold off
end

% Stop the video aquisition.


stop(vid);

% Flush all the image data stored in the memory buffer.


flushdata(vid);

DEPT OF ECE 75 KHIT


Leukemia detection using image processing by matlab

% --- Executes on button press in captureImg.


function captureImg_Callback(~, ~, handles)
% hObject handle to captureImg (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of captureImg


global vid;

% capture image
%inputimage = getframe(handles.rgb1);
inputimage = getsnapshot(vid);

% Stop the video aquisition.


stop(vid);
% Flush all the image data stored in the memory buffer.
flushdata(vid);
cla;

set(handles.captureImg,'Visible','off');

% call process function


cellsSegmentation(handles, inputimage, "rgb");
cellsSegmentation(handles, inputimage, "cmyk");
cellsSegmentation(handles, inputimage, "ycbcr");

%% Show alert result


success = msgbox('Process done.','Success');

function cellsSegmentation(handles, myImage, colorspace)

% load image and convert color space


myImage = convertColorSpace(colorspace, myImage);

%% WHITE BLOOD CELLS


if colorspace == "cmyk"
axes(handles.cmyk1);
WBC = handles.wbcCMYK;
RBC = handles.rbcCMYK;
elseif colorspace == "ycbcr"
axes(handles.ycbcr1);
WBC = handles.wbcYCbCr;
RBC = handles.rbcYCbCr;
else
axes(handles.rgb1);

DEPT OF ECE 76 KHIT


Leukemia detection using image processing by matlab

WBC = handles.wbcRGB;
RBC = handles.rbcRGB;
end
imshow(myImage);
set(handles.wbcText, 'string', 'Loaded Blood Smears Image');
pause(1);

%%Extracting the blue plane


if colorspace == "cmyk"
bPlane = myImage(:,:,1)- 0.4*(myImage(:,:,3)) - 0.6*(myImage(:,:,2));
else
bPlane = myImage(:,:,3) - 0.5*(myImage(:,:,1)) -
0.5*(myImage(:,:,2));
end
imshow(bPlane);
set(handles.wbcText, 'string', 'Extracted White Blood Cells');
pause(1);

%%Extract out purple cells


BW = bPlane > 29;
imshow(BW);
set(handles.wbcText, 'string', 'Enhanced Image');
pause(1);

%%Remove noise 100 pixels or less


BW2 = bwareaopen(BW, 100);
imshow(BW2);
set(handles.wbcText, 'string', 'Noise Removed');
pause(1);

%%Calculate area of regions


cellStats = regionprops(BW2, 'all');
cellAreas = [cellStats(:).Area];

%% create new figure to output superimposed images


% first display the original image
imshow(myImage), hold on

%% Label connected components


[L , ~]=bwlabel(BW2);
propied=regionprops(L,'BoundingBox');
himage = imshow(BW2);

%% Get the totalcellsRGB number of cells that have been added with
bounding box
whitecount = size(propied,1);

DEPT OF ECE 77 KHIT


Leukemia detection using image processing by matlab

%% Added bounding box to the white blood cells


hold on
for n=1:whitecount

rectangle('Position',propied(n).BoundingBox,'EdgeColor','g','LineWidth',
2)
end
hold off

%% Superimpose the two image


set(himage, 'AlphaData', 0.5);

%% set totalcellsRGB white blood cells detected


set(handles.wbcText, 'string', 'Process Done');
set(WBC, 'string', whitecount);
pause(2);

%% RED BLOOD CELLS


if colorspace == "cmyk"
axes(handles.cmyk2);
elseif colorspace == "ycbcr"
axes(handles.ycbcr2);
else
axes(handles.rgb2);
end
imshow(myImage);
set(handles.rbcText, 'string', 'Loaded Blood Smears Image');
pause(1);

%% Extracting the red plane


if colorspace == "cmyk"
rPlane = myImage(:,:,3) - 0.5*(myImage(:,:,1)) - 0.5*(myImage(:,:,2));
else
rPlane = myImage(:,:,1)- 0.4*(myImage(:,:,3)) - 0.6*(myImage(:,:,2));
end
imshow(rPlane);
set(handles.rbcText, 'string', 'Extracted Red Blood Cells');
pause(1);

%% Extract out red cells


BWr = rPlane > 19;
imshow(BWr);
set(handles.rbcText, 'string', 'Enhanced Image');
pause(1);

DEPT OF ECE 78 KHIT


Leukemia detection using image processing by matlab

%%Remove noise 100 pixels or less


BWr2 = bwareaopen(BWr, 100);
imshow(BWr2);
set(handles.rbcText, 'string', 'Noise Removed');
pause(1);

%%Calculate area of regions


cellStatsr = regionprops(BWr2, 'all');
cellAreasr = [cellStatsr(:).Area];

%% create new figure to output superimposed images


% first display the original image
imshow(myImage), hold on

%% Label connected components


[Lr , ~]=bwlabel(BWr2);
propiedr=regionprops(Lr,'BoundingBox');
himager = imshow(BWr2);

%% Get the totalcellsRGB number of cells that have been added with
bounding box
redcount = size(propiedr,1);

%% Added bounding box to the red blood cells


hold on
for n=1:redcount

rectangle('Position',propiedr(n).BoundingBox,'EdgeColor','r','LineWidth'
,2)
end
hold off

%% Superimpose the two image


set(himager, 'AlphaData', 0.5);

%% set totalcellsRGB white blood cells detected


set(handles.rbcText, 'string', 'Process Done');
set(RBC, 'string', redcount);
pause(1);

%% Calculate percentages
totalCells = whitecount + redcount;
wbcPercent = (whitecount ./ totalCells) .* 100;
rbcPercent = (redcount ./ totalCells) .* 100;

DEPT OF ECE 79 KHIT


Leukemia detection using image processing by matlab

if colorspace == "cmyk"
totalCellsHandle = handles.totalcellsCMYK;
WBCPercentHandle = handles.wbcpercentCMYK;
RBCPercentHandle = handles.rbcpercentCMYK;
resultTextHandle = handles.resultTextCMYK;
elseif colorspace == "ycbcr"
totalCellsHandle = handles.totalcellsYCbCr;
WBCPercentHandle = handles.wbcpercentYCbCr;
RBCPercentHandle = handles.rbcpercentYCbCr;
resultTextHandle = handles.resultTextYCbCr;
else
totalCellsHandle = handles.totalcellsRGB;
WBCPercentHandle = handles.wbcpercentRGB;
RBCPercentHandle = handles.rbcpercentRGB;
resultTextHandle = handles.resultTextRGB;
end

set(totalCellsHandle, 'string', totalCells);


set(WBCPercentHandle, 'string', sprintf('%i%%',vpa(wbcPercent)));
set(RBCPercentHandle, 'string', sprintf('%i%%',vpa(rbcPercent)));

if vpa(wbcPercent) >= 20
set(resultTextHandle, 'string', 'POTENTIAL LEUKEMIA
DETECTED');
else
set(resultTextHandle, 'string', 'Normal');
end

function myImage = convertColorSpace(color, myImage)


% convert RGB to other color space
if color == "cmyk"
cform = makecform('srgb2cmyk');
myImage = applycform(myImage,cform);
myImage = myImage(:,:,1:3);
elseif color == "ycbcr"
myImage = rgb2ycbcr(myImage);
else
myImage = myImage;
end

function exportData

% --- Executes on button press in exportData.


function exportData_Callback(~, ~, handles)
% hObject handle to exportData (see GCBO)

DEPT OF ECE 80 KHIT


Leukemia detection using image processing by matlab

% eventdata reserved - to be defined in a future version of MATLAB


% handles structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of exportData

%% Get all result data


cmykWbc = get(handles.wbcCMYK,'String');
cmykRbc = get(handles.rbcCMYK,'String');
cmykTotal = get(handles.totalcellsCMYK,'String');
cmykWbcP = get(handles.wbcpercentCMYK,'String');
cmykRbcP = get(handles.rbcpercentCMYK,'String');

yvbcrWbc = get(handles.wbcYCbCr,'String');
ycbcrRbc = get(handles.rbcYCbCr,'String');
ycbcrTotal = get(handles.totalcellsYCbCr,'String');
ycbcrWbcP = get(handles.wbcpercentYCbCr,'String');
ycbcrRbcP = get(handles.rbcpercentYCbCr,'String');

rgbWbc = get(handles.wbcRGB,'String');
rgbRbc = get(handles.rbcRGB,'String');
rgbTotal = get(handles.totalcellsRGB,'String');
rgbWbcP = get(handles.wbcpercentRGB,'String');
rgbRbcP = get(handles.rbcpercentRGB,'String');

%% Create tables
cmykTable =
table('CMYK',cmykWbc,cmykRbc,cmykTotal,cmykWbcP,cmykRbcP);
cmykTable.Properties.VariableNames = {'ColorSpace' 'WBCs' 'RBCs'
'Total' 'WBCsPercent' 'RBCsPercent'};

ycbcrTable =
table('YcBcR',yvbcrWbc,ycbcrRbc,ycbcrTotal,ycbcrWbcP,ycbcrRbcP);
ycbcrTable.Properties.VariableNames = {'ColorSpace' 'WBCs' 'RBCs'
'Total' 'WBCsPercent' 'RBCsPercent'};

rgbTable = table('RGB',rgbWbc,rgbRbc,rgbTotal,rgbWbcP,rgbRbcP);
rgbTable.Properties.VariableNames = {'ColorSpace' 'WBCs' 'RBCs'
'Total' 'WBCsPercent' 'RBCsPercent'};

% write to excel file


writetable(rgbTable,'LeukemiaResults.xlsx','Sheet',1);
writetable(cmykTable,'LeukemiaResults.xlsx','Sheet',2);
writetable(ycbcrTable,'LeukemiaResults.xlsx','Sheet',3);

%% Show alert result


success = msgbox('Data exported into Excel File.','Success');

DEPT OF ECE 81 KHIT


Leukemia detection using image processing by matlab

function totalcellsRGB_Callback(~, ~, ~)
% hObject handle to totalcellsRGB (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of totalcellsRGB as text


% str2double(get(hObject,'String')) returns contents of totalcellsRGB
as a double

% --- Executes during object creation, after setting all properties.


function totalcellsRGB_CreateFcn(hObject, ~, ~)
% hObject handle to totalcellsRGB (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function wbcpercentRGB_Callback(~, ~, ~)
% hObject handle to wbcpercentRGB (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of wbcpercentRGB as text


% str2double(get(hObject,'String')) returns contents of
wbcpercentRGB as a double

% --- Executes during object creation, after setting all properties.


function wbcpercentRGB_CreateFcn(hObject, ~, ~)
% hObject handle to wbcpercentRGB (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))

DEPT OF ECE 82 KHIT


Leukemia detection using image processing by matlab

set(hObject,'BackgroundColor','white');
end

function rbcpercentRGB_Callback(~, ~, ~)
% hObject handle to rbcpercentRGB (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of rbcpercentRGB as text


% str2double(get(hObject,'String')) returns contents of
rbcpercentRGB as a double

% --- Executes during object creation, after setting all properties.


function rbcpercentRGB_CreateFcn(hObject, ~, ~)
% hObject handle to rbcpercentRGB (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function totalcellsCMYK_Callback(~, ~, ~)
% hObject handle to totalcellsCMYK (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of totalcellsCMYK as text


% str2double(get(hObject,'String')) returns contents of
totalcellsCMYK as a double

% --- Executes during object creation, after setting all properties.


function totalcellsCMYK_CreateFcn(hObject, ~, ~)
% hObject handle to totalcellsCMYK (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

DEPT OF ECE 83 KHIT


Leukemia detection using image processing by matlab

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function wbcpercentCMYK_Callback(~, ~, ~)
% hObject handle to wbcpercentCMYK (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of wbcpercentCMYK as


text
% str2double(get(hObject,'String')) returns contents of
wbcpercentCMYK as a double

% --- Executes during object creation, after setting all properties.


function wbcpercentCMYK_CreateFcn(hObject, ~, ~)
% hObject handle to wbcpercentCMYK (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function rbcpercentCMYK_Callback(~, ~, ~)
% hObject handle to rbcpercentCMYK (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of rbcpercentCMYK as


text
% str2double(get(hObject,'String')) returns contents of
rbcpercentCMYK as a double

DEPT OF ECE 84 KHIT


Leukemia detection using image processing by matlab

% --- Executes during object creation, after setting all properties.


function rbcpercentCMYK_CreateFcn(hObject, ~, ~)
% hObject handle to rbcpercentCMYK (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function totalcellsYCbCr_Callback(~, ~, ~)
% hObject handle to totalcellsYCbCr (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of totalcellsYCbCr as text


% str2double(get(hObject,'String')) returns contents of
totalcellsYCbCr as a double

% --- Executes during object creation, after setting all properties.


function totalcellsYCbCr_CreateFcn(hObject, ~, ~)
% hObject handle to totalcellsYCbCr (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function wbcpercentYCbCr_Callback(~, ~, ~)
% hObject handle to wbcpercentYCbCr (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of wbcpercentYCbCr as

DEPT OF ECE 85 KHIT


Leukemia detection using image processing by matlab

text
% str2double(get(hObject,'String')) returns contents of
wbcpercentYCbCr as a double

% --- Executes during object creation, after setting all properties.


function wbcpercentYCbCr_CreateFcn(hObject, ~, ~)
% hObject handle to wbcpercentYCbCr (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function rbcpercentYCbCr_Callback(~, ~, ~)
% hObject handle to rbcpercentYCbCr (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of rbcpercentYCbCr as text


% str2double(get(hObject,'String')) returns contents of
rbcpercentYCbCr as a double

% --- Executes during object creation, after setting all properties.


function rbcpercentYCbCr_CreateFcn(hObject, ~, ~)
% hObject handle to rbcpercentYCbCr (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function wbcRGB_Callback(~, ~, ~)

DEPT OF ECE 86 KHIT


Leukemia detection using image processing by matlab

% hObject handle to wbcRGB (see GCBO)


% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of wbcRGB as text


% str2double(get(hObject,'String')) returns contents of wbcRGB as a
double

% --- Executes during object creation, after setting all properties.


function wbcRGB_CreateFcn(hObject, ~, ~)
% hObject handle to wbcRGB (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function rbcRGB_Callback(~, ~, ~)
% hObject handle to rbcRGB (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of rbcRGB as text


% str2double(get(hObject,'String')) returns contents of rbcRGB as a
double

% --- Executes during object creation, after setting all properties.


function rbcRGB_CreateFcn(hObject, ~, ~)
% hObject handle to rbcRGB (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

DEPT OF ECE 87 KHIT


Leukemia detection using image processing by matlab

function wbcCMYK_Callback(~, ~, ~)
% hObject handle to wbcCMYK (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of wbcCMYK as text


% str2double(get(hObject,'String')) returns contents of wbcCMYK as
a double

% --- Executes during object creation, after setting all properties.


function wbcCMYK_CreateFcn(hObject, ~, ~)
% hObject handle to wbcCMYK (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function rbcCMYK_Callback(~, ~, ~)
% hObject handle to rbcCMYK (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of rbcCMYK as text


% str2double(get(hObject,'String')) returns contents of rbcCMYK as
a double

% --- Executes during object creation, after setting all properties.


function rbcCMYK_CreateFcn(hObject, ~, ~)
% hObject handle to rbcCMYK (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.

DEPT OF ECE 88 KHIT


Leukemia detection using image processing by matlab

if ispc && isequal(get(hObject,'BackgroundColor'),


get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function wbcYCbCr_Callback(~, ~, ~)
% hObject handle to wbcYCbCr (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of wbcYCbCr as text


% str2double(get(hObject,'String')) returns contents of wbcYCbCr as
a double

% --- Executes during object creation, after setting all properties.


function wbcYCbCr_CreateFcn(hObject, ~, ~)
% hObject handle to wbcYCbCr (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function rbcYCbCr_Callback(~, ~, ~)
% hObject handle to rbcYCbCr (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of rbcYCbCr as text


% str2double(get(hObject,'String')) returns contents of rbcYCbCr as
a double

% --- Executes during object creation, after setting all properties.


function rbcYCbCr_CreateFcn(hObject, ~, ~)
% hObject handle to rbcYCbCr (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB

DEPT OF ECE 89 KHIT


Leukemia detection using image processing by matlab

% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

DEPT OF ECE 90 KHIT


Leukemia detection using image processing by matlab

CODE – 2 :

clc;close all;clear all;


I=imread('F1.jpg');
I=imresize(I,[200,300]);
size(I)
figure
imshow(I)

rgb = imopen(I,strel('disk',1));

figure;
imshow(rgb);
title('background')
gray_image = rgb2gray(rgb);
imshow(gray_image);

[centers, radii] = imfindcircles(rgb,[2


80],'ObjectPolarity','dark','Sensitivity',0.9)
imshow(rgb);

cell = length(centers)
M = mean(radii)
max = max(radii)

h = viscircles(centers,radii)

red=rgb(:,:,1);green= rgb(:,:,2); blue= rgb(:,:,3);

out=red>25 & red<199 &green<130 & blue>140 & blue<225;

DEPT OF ECE 91 KHIT


Leukemia detection using image processing by matlab

out1=imfill(out,'holes');
out2=bwmorph(out1,'erode');

out3=bwmorph(out2,'dilate',1.2);
out3=imfill(out3,'holes');
out3=bwareaopen(out3,100);

figure;
imshow(out3);
title('Cancer cells')
out3=im2bw(out3);
[l,NUM]=bwlabel(out3,4);

cancer=(NUM/cell)*100;
disp('Myeloid cells percentage is')
disp(cancer);
if cancer<0.8
disp('Healthy. No Problem');
elseif cancer<1 & cancer>0.5
disp('High myeloid cell concentration.');

elseif cancer > 1 & cancer < 8


disp('Initial Stage Leukemia');

elseif cancer > 8


disp('Advanced Stage Leukemia');

end

DEPT OF ECE 92 KHIT


Leukemia detection using image processing by matlab

References
[1] http://www.cancer.gov

[2] http://cancerresearchuk.org

[3] http://medicinenet.com

[4] http://www.abpischools.org.uk – cancer cells

[5] http://en.m.wikipedia.org/wiki/Image_segmentation

[6] S.Jagadeesh , Dr.E.Nagabhooshanam , Dr.S.Venkatachalam , “Image


Processing Based Approach to Cancer Cell Prediction in Blood Samples”,
International Journal of Technology and Engineering Sciences, Vol.1 (1),
ISSN: 2320-8007.
[7] Vinay Parameshwarappa, Nandish S,”A Segmented Morphological
Approach to Detect Tumour in Brain Images”,International Journal of
Advanced Research in Computer Science and Software Engineering, ISSN
2277 128X, Volume (4), Issue (1), January 2014.

[8] Bhagyashri G. Patil, Prof. Sanjeev N. Jain,” Cancer Cells Detection Using
Digital Image Processing Methods”, International Journal of Latest Trends in
Engineering and Technology (IJLTET),vol.3 ISSN: 2278-621X, 2014.
[9] Sivappriya T , Muthukumaran K, “Cancer Cell Detection Using
Mathematical Morphology”, International Journal of Innovative Research
inComputer and Communication Engineering, Vol.2, Special Issue 1, March
2014.
[10] Ms.Chinki Chandhok, Mrs.Soni Chaturvedi, Dr.A.A Khurshid, ” An
Approach to Image Segmentation using K-means Clustering Algorithm”,
International Journal of Information Technology (IJIT), Volume – 1, Issue –
1, August 2012.
[11] Richa Dandotiya, Shailendra Singh and Shailesh Jalori,”A Survey of
Image Classification Techniques for Flood Monitoring System”,International
Conference on Emerging Trends in Computer and Image Processing
(ICETCIP‟2014) DEC. 15-16, 2014 Pattaya (Thailand).
[12] Nimesh Patel,Ashutosh Mishra.Automated Leukemia Detection Using
Microscopic images. Sci.2015(12-16).

DEPT OF ECE 93 KHIT


Leukemia detection using image processing by matlab

[13] Amit Kumar Mandal, Dilip Kumar Baruah.Image Segmentation Using Local
Thresholding and Ycbcr Colour Space.J Appl Sci2010.

[14] Sinha N,Ramakrishnan AG.Automation of differential blood count.In Chock-


alingam A,editor.Proceedings of the conference on convergent technologies for
the Asia pacific region,October 5-17.Taj Residency Bangalore:IEEE
Publisher;2003 p.

[15] Kovalev VA, Grigoriev AY, Ahn H. Robust recognition of white blood cell
images. In: Kavanaugh ME, Werner B, editors. Proceedings of the 13th
international conference on pattern recognition, August 25-29. Vienna, Austria:
IEEE Publisher;1996. p.

[16] Madhloom Ht,Kareem.An automated white blood cell nucleus localisation and
segmentation using image arithmetic and automated threshold.J Appl Sci2010.

[17] Nobuhito Matsushrio. Color image information processing, 14-16 July.


Boston,MA, USA: IEEE Publisher; 2004. p.

[18] Halim NHA, Mashor MY, Hassan R. Automatic blasts counting for acute
leukemia based on blood samples. Int J Res Rev Comput Sci 2011; 2(August
(4)).

[19] Mohapatra S, Patra D, Satpathy S. An ensemble classifier system for early


diagnosis of acute lymphoblastic leukemia in blood microscopic images.IEEE
Publisher; 2008.

[20] Donida Labati R, Piuri V, Scotti F. ALL-IDB: the acute lymphoblastic leukemia
image Database for image processing. In: Macq Benot, Schelkens Peter, editors.
Proceedings of the 18th IEEE ICIP international conference on image
processing.

[21] H. Ramoser, V. Laurain, H. Bischof and R. Ecker, "Leukocyte segmentation and


classification in blood-smear images," in IEEE

[22] Engineering in Medicine and Biology, Shanghai, 2005.G. Lebrun, C. Charrier,


“A fast and efficient segmentation scheme for cell microscopic image,” in
Cellular and Molecular BiologyTM 53, N°2, 51-61, 2007 .

[23] Marco Antonio Garcia de Carvalho ,Tiago William Pinto, Roberto Marcondes
C´esar J´unior,” Image Segmentation Using Watershed and Normalized Cut”.

DEPT OF ECE 94 KHIT


Leukemia detection using image processing by matlab

[24] G. Ongun, U. Halici, K. Leblebicioglu and V. Atala, "An automated differential


blood count system," in Int. Conf. of the IEEE Engineering in Medicine and
Biology Society, 2001, Istanbul.

[25] Mohapatra, Saurav, Dipti Patra, Sudhakar Kumar, and Siddhartha Satpathi.
"Kernel induced rough c-means clustering for lymphocyte image segmentation."
In Intelligent Human ComputerInteraction (IHCI), 2012 4th International
Conference on, pp. 1-6. IEEE, 2012 .

[26] Raje, Chaitali, and Jyoti Rangole. "Detection of Leukemia in microscopic


images using image processing." In Communications and Signal Processing
(ICCSP), 2014 International Conference on, pp. 255-259. IEEE, 2014.

[27] Berge, Heidi, Dale Taylor, Sriram Krishnan, and Tania S. Douglas. "Improved
red blood cell counting in thin blood smears." In Biomedical Imaging: From
Nano to Macro, 2011 IEEE International Symposium on, pp. 204-207.

[28] Abdul Nasir, A. S., M. Y. Mashor, and H. Rosline. "Unsupervised colour


segmentation of white blood cell for acute leukaemia images." In Imaging
Systems and Techniques (IST), 2011 IEEE International Conference on, pp.
142-145. IEEE, 2011.

[29] Rubhala, "Image segmentation of leukemia using kernel based fuzzy c means
clustering", International Journal of Communications and Engineering Volume
03 No.3, Issue: 03 March2012

[30] Juma Al-Muhairy, Yousef Al-Assaf, "Automatic white blood cell segmentation
based on image processing", 2005 IFAC

[31] Nipon Theera-Umpon, "Patch-Based White Blood Cell Nucleus Segmentation


Using Fuzzy Clustering", ECTI transactions on electrical eng., electronics, and
communications vol.3, no.1 February 2005

[32] Fabio Scotti, "Automatic Morphological Analysis for Acute Leukemia


Identification in Peripheral Blood Microscope Images", CIMSA 2005 IEEE
International Conference on Computational Intelligence for Measurement
Systems and Applications Giardini Naxos, Italy, 20-22 July 2005

[33] T. Markiewicz and S. Osowski, "Data mining techniques for feature selection in
blood cell recognition", ESANN'2006 proceedings of Symposium on Artificial

DEPT OF ECE 95 KHIT


Leukemia detection using image processing by matlab

Neural Networks Bruges (Belgium), 26-28 April 2006, d-side publi., ISBN 2-
930307-06-4.

[34] Nipon Theera-Umpon, "Morphological Granulometric Features of Nucleus in


Automatic Bone Marrow White Blood Cell Classification", IEEE transactions on
information technology in biomedicine, VOL. 11, NO.3, MAY 2007.

[35] S. H. Rezato_ghi H. Soltanian-Zadeh R. Shari_an R.A. Zoroo_, "A New


Approach to White Blood Cell Nucleus Segmentation Based on Gram Schmidt
Orthogonalization", International Conference on Digital Image Processing, 2009
IEEE

[36] Madhumala Ghosh', Devkumar Das, Subhodip Mandal, Chandan Chakraborty,


Mallika Pal, Ashok K Maity, Surjya K PaIn, "Statistical Pattern Analysis of
White Blood Cell Nuclei Morphometry", Proceedings of the 2010 IEEE
Students' Technology Symposium 3-4 April 2010, IIT Kharagpur.

[37] P.S.Hiremath, “Automated Identification and Classification of White Blood


Cells (Leukocytes) in Digital Microscopic Images", IJCA Special Issue on
Recent Trends in Image Processing and Pattern Recognition, RTIPPR, 2010.

[38] Cancer facts and figures 2013, American cancer society.

[39] Fauziah Kasmin, Anton Satria Prabuwono, Azizi Abdullah, "Detection of


leukemia in human blood sample based on microscopic images: a study",
Journal of Theoretical and Applied Information Technology, 31st December
2012. Vol. 46 No.2.

[40] Ms.Minal D. Joshi, Prof. A. H. Karode, Detection of Acute Leukaemia using


White blood Cells Segmentation based on Blood Samples, International Journal
of Electronics and Communication Engineering and Technology, Vol 4, Issue 3,
May-June 2013,pp. 148-153.

[41] Aimi Salihah, A. N., M.Y. Mashor, Azian Azamimi Abdullah, Improving Blast
Segmentation of cute Myelogenous Leukaemia (AML) Images Using Bright
stretching Technique, Proceedings of International Post Graduate Conference on
Engineering (IPCE 2010), 16th – 17th oct. 2010, Perlis, Malaysia.

[42] Madhloom HT, Kareem SA, Ariffin H, Zaidan AA, Alanazi HO, Zaidan BB, An
automated white blood cell localization and segmentation using image
arithmetic and automatic threshold, J Appl Sci 2010;10(11);959-66.
DEPT OF ECE 96 KHIT
Leukemia detection using image processing by matlab

[43] Sinha N, Ramakrishnan AG, Automation of differential blood count, In: Chock-
Alignam A, editor. Proceedings on the conference on convergent technologies
for the Asia-Pacific region, October 15-16. IEEE Publisher: 2003, p. 371-5.

[44] Scotti F, Robust segmentation and measurements of white cells in blood


microscopic images, In: Daponte P, Linnenbrink T, editor. IEEE Publisher:
2006, p 43-8.

[45] M. Ghosh, D. Das, C. Chakraborty and A.K. Ray, Automated leukocyte


recognition using fuzzy divergence. Micron, 41(7):840-846, 2010.

[46] J. Angulo and G. Flandrin, Microscopic image analysis using mathematical


morphology: Application to haematological cytology, Science, Technology and
Education of Microscopy: An Overview, pages 304-312.

DEPT OF ECE 97 KHIT

You might also like