automatic red blood cell counting based on...

38
AUTOMATIC RED BLOOD CELL COUNTING BASED ON PARTICLE AREA RABIAHTULADAWIAH BINTI MUSA A project report submitted in partial fulfillment of the requirement for the award of the Master of Electrical Engineering Faculty of Electrical and Electronic Engineering Universiti Tun Hussein Onn Malaysia JUNE 2015

Upload: lynguyet

Post on 12-Mar-2019

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

AUTOMATIC RED BLOOD CELL COUNTING BASED ON PARTICLE AREA

RABIAHTULADAWIAH BINTI MUSA

A project report submitted in partial

fulfillment of the requirement for the award of the

Master of Electrical Engineering

Faculty of Electrical and Electronic Engineering

Universiti Tun Hussein Onn Malaysia

JUNE 2015

Page 2: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

iv

ABSTRACT

In medical area, red blood cell (RBC) counting and analysis contributes important

information in pathological diagnosis regarding disease such as anemia and low level of

hemoglobin concentration. Normally the blood sample is processed in laboratory using

hematology analyzer and blood smear is viewed under microscope. The analysis and

counting process is conducted manually by pathologist. The task is very laborious,

tedious, time-consuming and very dependent to the skill. This project applied image

processing techniques to develop a computer-aided system for automated RBC counting.

The RBC images will be pre-processed in early stage using morphological operations

and thresholding to obtain the images with good quality. Then, the RBC images will be

classified based on the particle area size into single and multi-overlap cells. For counting

the total number of the RBC, mathematical numeric function is used. The accuracy of

the result is determined by doing comparison with the ground truth data. The proposed

method has been tested to the RBC images and performs a reliable system for counting

RBC.

Page 3: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

v

ABSTRAK

Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

informasi penting bagi diagnosis patologi berkenaan penyakit seperti anemia dan level

kepekatan hemoglobin yang rendah. Kebiasaannya sampel darah diproses di dalam

makmal menggunakan “hematology analyzer” (iaitu sejenis peralatan elektronik yang

menguji bahan secara kimia) dan sampel darah diperhatikan di bawah mikroskop.

Analisis dan proses pengiraan dijalankan secara manual oleh ahli patologi. Tugasan

tersebut sangat rumit, memenatkan, mengambil masa dan sangat bergantung kepada

kemahiran. Projek ini mengaplikasi teknik pemprosesan imej untuk menghasilkan suatu

system berkomputer yang dapat mengira sel darah merah secara automatic. Imej sel

darah merah akan diproses awal menggunakan “morphological operation” dan

“threshold” untuk mendapatkan imej yang berkualiti baik. Kemudian imej akan

dikelaskan mengikut saiz “particle area” kepada satu sel dan sel yang berganda. Bagi

mengira jumlah sel darah merah, fungsi matematik digunakan. Ketepatan keputusan

akan dinilai dan dibandingkan dengan data asal (kiraan sebenar). Kaedah yang

dicadangkan ini telah diuji dan menunjukkan keberkesanannya untuk mengira sel darah

merah.

Page 4: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

vi

CONTENTS

TITLE i

DECLARATION ii

ACKNOWLEDGEMENT iii

ABSTRACT iv

CONTENTS vi

LIST OF TABLES viii

LIST OF FIGURES ix

LIST OF SYMBOLS AND ABBREVIATIONS xi

CHAPTER 1 INTRODUCTION 1

1.1 Research background 1

1.2 Problem statement 5

1.3 Aim and objectives 5

1.4 Scope of the project 6

CHAPTER 2 LITERATURE REVIEW 7

2.1 Image processing in RBC segmentation and counting 7

2.2 Summary 12

Page 5: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

vii

CHAPTER 3 METHODOLOGY 14

3.1 Research workflow 14

3.1.1 Image acquisition 15

3.1.2 Image pre-processing 16

3.1.2.1 Threshold 17

3.1.2.2 Morphological operations 22

3.1.3 Segmentation and classification 24

3.1.4 RBC counting and validation 26

3.2 Summary 28

CHAPTER 4 RESULT AND ANALYSIS 29

4.1 Pre-processing RBC images 29

4.2 RBC classification and counting based on particle area 32

4.3 RBC counting using connected component labeling

method 40

4.4 Accuracy and error of the results 42

4.4 Summary 52

CHAPTER 5 CONCLUSION 54

5.1 RBC counting result 54

5.2 Recommendation for future works 55

5.3 Summary 56

REFERENCES 57-60

Page 6: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

viii

LIST OF TABLES

3.1 Comparison of each RGB channel for thresholding purpose 20

3.2 Range of particle area for each group of RBC 25

4.1 Result of RBC counting based on particle area 37

4.2 Result of RBC counting using CCL method 42

4.3 Ground truth data 46

4.4 Percentage accuracy of RBC counting 48

4.5 Percentage error of RBC counting 50

Page 7: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

ix

LIST OF FIGURES

1.1 Red blood cell shape 2

1.2 Normal and sickle RBC 3

1.3 Image of blood smear 4

2.1 Circle Hough Transform accumulation array 9

2.2 Separating overlapped objects using distance transform and

watershed 9

2.3 Morphological reconstruction to remove unwanted object 10

3.1 Work flow 15

3.2 Process of image acquisition from light microscope 16

3.3 Pre-processing flow diagram 17

3.4 Binary image 18

3.5 Tresholding value setting 20

3.6 Comparison of threshold images in different RGB channels 21

3.7 Configure object filter 26

3.8 Classification and counting flow chart 27

3.9 Mathematic numerical model for counting RBC 28

Page 8: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

x

4.1 Conversion to binary image 30

4.2 Original RBC image (img1) 30

4.3 RBC image under pre-processing steps 31

4.4 Single RBC detection 34

4.5 Overlap RBC detection 35

4.6 RBC image are tagged in numbering 36

4.7 RBC counting result by classes 38

4.8 Classification and counting result of image img1 39

4.9 Result images of CCL method 41

4.10 Actual count of image img1 43

4.11 Result of original and processed images 44-45

4.12 Particle area method results compared with actual counts 49

4.13 CCL method result compared with actual counts 51

4.14 Comparative chart of measured and actual counts for both methods 52

Page 9: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

xi

LIST OF SYMBOLS AND ABBREVIATIONS

RBC - Red Blood Cell

WBC - White Blood Cell

Hb - Hemoglobin

O2 - Oxygen

CO2 - Carbon dioxide

ME - Myalgic Encephalomyelities

MS - Multiple Sclerosis

MATLAB - Matrix Laboratory (A programming software)

Open CV - Open source Computer Vision (A programming software)

NI - National Instrument

AI - Automated Inspection

RGB - Red Green Blue (colour channel)

CHT - Circle Hough Transform

ANN - Artificial Neural Network

CCL - Connected Component Labelling

PCNN - Pulse Coupled Neural Network

MSE - Mean Squared Error

Page 10: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

xii

LIST OF APPENDICES

APPENDIX TITLE PAGE

A SAMPLE IMAGES 57-60

B RBC COUNTING RESULT 61

C CONFERENCE PAPER 62-71

D MATLAB CODING 72

Page 11: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

1

CHAPTER 1

INTRODUCTION

This chapter will describe the background, problem statement and objectives of the

research. It consist the definition of the terms that being studied such red blood cell and

image processing. This research is applying knowledge of image processing for solving

some issues that exist in medical area especially in the red blood cell analysis.

1.1 Research Background

Blood is a connective tissue consisting of red blood cells (RBC), white blood

cells (WBC), and platelets suspended in plasma. As a medium of transportation for the

whole body, blood composition is very vital to be monitored when it comes to medical

inspection. RBC or erythrocytes are normally in round shape, biconcave and flattened,

about 7 µm in diameter and 2.2 µm thick as shown in Figure 1.1. Unlike WBC, RBC

lack of nuclei and contains of Hemoglobin (Hb) protein to carry oxygen (O2) and carbon

dioxide (CO2) molecules in respiration system. The shape provides an increased surface

area and size for diffusion process between blood and tissues [14].

Page 12: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

2

Figure 1.1: Red blood cell shape [22]

RBC can be found in normal and abnormal or sickle shape (Figure 1.2). Normal

RBC is disc-shaped and looks like a doughnut without a hole in the center. It can live

about 120 days. Sickle cells contain abnormal hemoglobin called sickled hemoglobin or

hemoglobin S (HbS). Sickle cells usually indicate anemia disease and the shape is like a

crescent. It tends to block the blood flow in small capillary and lead to severe pain and

organ damage as well as risk of infection [26].

In medical area, RBC analysis contributes information of pathological diseases

and condition. It helps doctors to determine the appropriate treatment to the patient. Any

condition which there is an abnormally low of hemoglobin concentration or red blood

cell count is indicating to anemia [14], low of specific vitamin [7] and might be

secondary effect of several other disorders [24]. The shape of RBC and its deformability

or abnormality has connection to the relevant disease such as Huntington’s desease,

Myalgic Encephalomyelities (ME) and Multiple Sclerosis (MS) [14].

Page 13: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

3

However some factors should be taken into consideration when perform the RBC

counting, including level age of people (which is children and adult, younger and older)

and strenuous physical activity [24]. From that, the accurate diagnosis is very important

to determine the exact disease and prepare the correct treatment to the patient.

Figure 1.2: Normal and sickle RBC [26]

Normally the blood sample is taken and processed in the laboratory by using

chemical electronic devices such as hemocytometer or hematology analyzer. This task is

manually done by lab technologist. It is tedious and very dependent to their skill

especially to count and analysis the cell through microscope [7]. The counting and

analysis process is difficult when the cells are overlapped, usually such a finding

neglected, and sometimes other particles such as platelet and WBC interfere too (Figure

1.3). The conventional method is time-consuming to complete and the counting task is

laborious [5].

Page 14: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

4

Image processing is very useful and widely used nowadays as alternative for

improving the way of RBC counting and analysis. It improves the effectiveness of the

analysis in term of accuracy, time consuming and cost. Such a procedure has been used

in medical diagnosis for processing blood cell image especially for segmenting RBC

from its complex environment in the blood. Segmentation of cell image is the key of

medical image processing that directly impact the analysis and accuracy of the work

[13]. From the analysis and counting, it will lead the doctor to make a decision of a

patient health status. Various software provide tool for image processing such as

MATLAB [7], Microsoft Visual Studio and Open CV [1], Lab VIEW [2], telemetry

system [3] and in this project, National Instrument (NI) Vision Builder Automated for

Inspection (AI). Most of the techniques can be found in the software, the importance is

the understanding of how to apply it to obtain the desired outcome.

Figure 1.3: Image of Blood Smear

Page 15: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

5

1.2 Problem Statement

Current method to count and analysis RBC is using a laboratory device known as

hematocytometer. It consists of a thick glass microscope slide with a rectangular

indentation creating a chamber of certain dimensions. This chamber is etched with a grid

of perpendicular lines. It is possible to count the chamber of cells in a specific volume of

fluid and calculate the concentration of cells in the fluid [20]. To count blood cells, lab

technologist must view hemocytometer through a microscope and count blood cells

using hand tally counter. However, the overlapped blood cells cannot be counted by

using hemocytometer and be neglected. This method is laborious, tedious and time

consuming to complete it. Knowledge, skill and experience will help to identify and

count the cells.

RBCs are not suspended alone in the blood volume thus the issue of how to

distinguish and segment RBCs from other components of blood such as WBCs, platelet

and plasma is always being raised. Besides, those cells sometimes are found overlapping

and clumping to each other. The complicated and high degree of overlapping condition

is very difficult to solve. There is also possibility of having irregular and normal shape

of cells that mix and stick together.

Development of automated system for analysis and counting RBCs in the blood

sample is very useful. It will improve the existing method and help the pathologist and

doctors to diagnose the patients accurately.

1.3 Aim and Objectives

The aim of this project is to count the total number of red blood cell in blood

samples since medical diagnosis concern about that pretty much. The accuracy of the

result for the RBC number in a sample image and fast performance of operation will also

be the aims of this project. From the total count of RBCs, it can help the doctors

determine the disease of the patient. To support the aims, there are objectives that will be

formulated and focused in this project.

Page 16: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

6

The objectives of this project are:

1. To develop a method for automatically segment out RBC region in various

environment condition.

2. To construct a procedure for counting the RBC number in overlapping and non-

overlapping condition.

3. To access the performance of the develop method in real condition.

1.4 Scope of the Project

This project will be focusing in the boundary that related to the stated objectives. It

will involve the image processing techniques and come out with the algorithm for

counting the RBC numbers.

Page 17: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

7

CHAPTER 2

LITERATURE REVIEW

This chapter will discuss the previous researches that have been done within the same

area of the topic. Literature review is important to tell whether the research is relevant

and feasible to be studied. It also can be a guidance and boundary so that the research is

reasonable and can produce some useful findings. The review is done on the techniques

used for processing image and counting the RBC.

2.1 Image Processing in RBC Segmentation and Counting

Image processing is a successive tool to improve the capability of human to

identify and extract the important information or data from images or video by using a

machine language [7]. Image can be defined as a matrix of light intensity level that can

be manipulated or operated by using computer algorithm [10]. Image processing

provides many techniques to increase the effectiveness of decision making, shorten the

consumed time and reduce the cost [4, 18].

Page 18: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

8

The use of image processing for RBC analysis has been produced in previous

studies. Many techniques and algorithm have been proposed to achieve the good

findings. Recent studies on this area mainly focus in segmenting and classification of the

cells for counting purpose.

Software based for developing automatic system to analysis RBC can reduce cost

compared to expensive hardware that being used nowadays. There are several examples

of software that commonly used to perform image processing such as MATLAB, Open

CV, and Lab View. This project uses a part of embedded system of NI Lab View which

is Vision Builder. Image processing techniques mostly were utilized to perform pre-

processing, segmentation of the image, classification or identification and counting the

cells.

The images basically are obtained from the samples of blood that being captured

using light microscope which the process involve the preparation of blood smear in the

lab [1, 7]. Blood smear is a process to put the blood specimen on the slide that being

observed under the microscope. The image then will be filtered to reduce or minimize

the noise such as using average or median filter. The conversion of colour from RGB

into other channels helped in solving illumination problem [7] and as a preparation for

the next stage of image processing.

According to Ventalakshmi in 2013 [3] histogram thresholding and

morphological operator is used to segment the image as well to extract or differentiate

RBC from other cells (WBC and platelets) and its background. For RBC counting

process, Circle Hough Transform (CHT) technique is used to find a circle characterized

by a center point and a known radius (Figure 2.1). CHT is modified version from classic

Hough Transform that detect parametric curve in images. Another paper is by Wei et. al

in 2009 [16] that adopting extended HT for cover different sizes of co-center circles and

multiple radii called Multi-Scale Circular Hough Transform (MSCHT).

Page 19: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

9

Figure 2.1 : Circle Hough Transform accumulation array [23]

Study by Sharif et. al in 2012 [7] proposed mathematical morphological operator

to segment the image based on elimination of WBC. The step involved erosion, dilation,

opening, closing and reconstruction. To separate the overlapped cells, marker controlled

watershed algorithm is used where it based on the distance of overlapping cells (Figure

2.2). However, it still has weaknesses where it cannot handle the area that contains

important information.

Figure 2.2: Separating overlapped objects using distance transform and watershed

[redrawn using MATLAB]

Page 20: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

10

In 2013, Tulsani et. al [6] also implemented the similar method of morphological

watershed transform algorithm for segmentation of the cells (Figure 2.3). The paper also

proposed a technique to eliminate WBC and platelet by using color conversion in

YCbCr format. The Cb component has been chosen as it showed the clear appearance of

WBC and platelets.

An improvement has been made before that by Huang in 2010 [13] that

combined the watershed algorithm with mathematical morphology using corrosion and

expansion algorithm.

Figure 2.3: Morphological reconstruction to remove unwanted object (a) Mask

(b) Marker (c) Result [redrawn from [6]]

A paper from Nguyen in 2010 [12] proposed algorithm for splitting the clumped

cells. It used Otsu’s algorithm for getting threshold in order to separate background and

foreground and for detection of cell central points, it applied Euclidean distance

transform. The advantages of this method are it can reduce the disadvantage of

concavity analysis methods and model-based approach, detect other distorted structures

and independent cell size and the merge process is much simpler compared to watershed

segmentation merge process. Concavity analysis is measuring split lines in overlapped

cells but has the problem that cannot cope with multiple overlapping cells. However,

Page 21: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

11

there was still weakness regarding quality of the image such as blur and non-focused

image.

In study by Tomari et.al in 2014 [1], the image was processed through three

main stages which is segmentation, feature extraction and classification. Segmentation

process was done by using adaptive global thresholding. The extracted features such as

moment values, area and perimeter are used to identify overlapping and non-overlapping

region. For classification, artificial neural network (ANN) classifier is used to train and

test the data.

Multilayer perceptron artificial neural network is a method used to classify RBC

as proposed by Jambhekar in 2011 [10]. In the paper too, segmentation process was

performed using histogram thresholding. By removing the overlapped cells, it

successively counted the number of RBC and WBC. The result also showed the

complete health RBC and incomplete non-circular (sickled cells) of RBC. The accuracy

was 81% and increased when training was increased.

Another paper by Poomcokrak in 2008 [18] also implemented ANN to classify

and count RBC. The function was performed by adjusting the weight between the

elements and the mean squared error (MSE) was calculated. The value obtained is used

to separate sickle RBC from normal RBC and the number of normal RBC is counted.

The result shows 74% accuracy of counting RBC.

Natsution in 2008 [17] reported a comparison of two methods for counting RBC.

It used backprojection ANN and connected component labelling (CCL). The result

showed the accuracy was higher (86.97%) by using ANN back projection than using

CCL (87.74%).

Other method used for segmentation and counting process by Adagale in 2013

[4] was Pulse Coupled Neural Network (PCNN) combined with template matching

algorithm since PCNN alone cannot cope with overlapped cells. PCNN consider

overlapped cells as a single cell. Template matching uses a template of RBC to be

matched to the object for separating small cell in shape and size. However the accuracy

decreased whenever the RBCs are overlapped totally because the area of one cell was

considered as a template and the algorithm works only in 100x microscope scale.

Page 22: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

12

Contour tracing approach has been used to segment scanning electron

microscope (SEM) images as reported by Vromen in 2009 [15]. The method viewed

contour detection and negotiating perceived problem areas one at a time but it still has

lack when facing overlapping cells. It applied Bayesian tracking framework. The

contours were categorized into three fully correct, minimally obscured and incorrect.

The result showed 95.7% were either unobscured or minimally obscured with 0.6% false

negative and 4.3% false positive.

A study by Ajay in 2014 [2] used Lab View software with Vision Assistant to

apply morphological operation for diagnosis blood cells in real time. It implemented

pattern matching method to identify the abnormal RBC for anemia analysis. It also

developed a man-machine interface so that the procedure could be in real time and user

friendly.

Using Lab View software too, Goyal in 2006 [21] proposed an artificial

intelligent method for diagnosis anemia disease using the concept of fuzzy logic. It has

two parts; find the group of disease using fuzzy interferences and another one using

knowledge base.

From the previous researches, the process that apparently important was

segmentation or classification of the RBC from the blood image. To execute the process,

most of the studies applied the similar method as stated above. They also improved the

classic method for getting the better result or to complement their objective.

In this project, there are two methods will be applied to count RBC number.

First, segmentation and object detection based on particle area and then mathematical

function to count. This method is implemented using NI Vision Builder AI. Second,

finding and counting connected objects in binary image using MATLAB.

2.2 Summary

RBC counting and analysis using image processing is not a new thing in medical

diagnosis. It always goes through improvement as a new research is carried out. The

researchers offered many different methods as long as it can be giving a better accuracy

Page 23: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

13

and promising results. However there are still weaknesses and constraints due to the

image itself such as color similarity, weak edge boundary, overlapping condition, image

quality, contrast, brightness, illumination and noise. Thus, more studies must be done to

handle those matters to produce strong analysis approach for medical diagnosis purpose.

This project is hoped can build a better solution and help to improve the current methods

so that it can be more capable, robust, and effective whenever any sample of blood cell

is analyzed.

Page 24: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

14

CHAPTER 3

METHODOLOGY

This chapter will discuss the method or technique used to achieve the research aim. The

discussion will be based on the image processing steps used for analysis the RBC image

which has been shown in the project work flow.

3.1 Research Work Flow

The research work flow is showing steps on how to achieve the objective. The

flow is including image acquisition, image pre-processing, segmentation and

classification of cells, RBC counting and validation. The explanation of each step is

included to give a clear understanding of the methods.

Page 25: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

15

Figure 3.1: Work flow

3.1.1 Image acquisition

The blood images are captured by using light microscope which the blood

sample or specimen, specifically called blood smear, is viewed under the microscope.

Blood smear is the process of preparing the blood specimen onto the slide to be observed

under microscope. This is done in laboratory. To display the images, the process

involves the digitization of image and interpolation from optical image with 40X

objective (Figure 3.2). Those processes create noise and distortion to the images. Hence,

the images are then need to be pre-processed in the next stage.

Image acquisition

Pre-processing

Segmentation and classification

RBC counting and validation

Page 26: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

16

Figure 3.2: Process of image acquisition from light microscope

3.1.2 Image pre-processing

Pre-processing of the images is a stage for improving quality of the images. It is

using digital image processing software that available to process several steps including

color conversion and thresholding, enhancement and filtering, contrast improvement and

brightness correction, and several morphological operation. In this project, National

Instrument (NI) Vision Builder for Automated Inspection (AI) and Vision Assistant and

MATLAB are used as image processing tool. The flow of pre-processing image is

illustrated in Figure 3.3.

Page 27: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

17

Figure 3.3 Pre-processing flow diagram

3.1.2.1 Threshold

The original image is in RGB colour. RGB color image has 24 bits (8 bits red, 8

bits green and 8 bits blue) and the problem of this image is backward compatibility with

older hardware that may not be able to display 16 million colors in one time. Before pre-

processing stage, the image has to be prepared in binary or monochrome representation

for convenience and fast processing. Gray level (monochrome) has 8 bits per pixel and

range from 0 (black) to 255 (white) in between gray while binary image has 1 bit per

pixel which is 0 for black and 1 for white (Figure 3.4).

Page 28: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

18

Figure 3.4: Binary image [Marques,MATLAB]

Threshold is actually an initial and a simplest non-contextual technique to

segment the image. It can distinguish the object or foreground from the background. It is

based on intensity of the image where it determines which pixels belong to object and

which pixels should be labeled as background.

The process is comparing each of pixel intensity with a reference value or

threshold and replacing it with a value that means white or black depending on the

outcome of the comparison. Mathematically, the process of thresholding an input image

f(x,y) and producing a binarized version g(x,y) can be expressed as equation (1):

𝑔(𝑥, 𝑦) = { 1 𝑖𝑓 𝑓(𝑥, 𝑦) > 𝑇0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

where T is threshold. When the same value of T is adopted for the entire image, it is

called global thresholding and when the choice of value for T at a point of coordinates

(1)

Page 29: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

19

(x,y) depends on statistical properties of pixel values in a neighborhood around (x,y), it

is called local or adaptive thresholding.

In global thresholding, a single value of T is used as a threshold for the entire

image. To choose the value of T, it can be done manually or automatically and there are

many strategies for selecting threshold values. They rely on assumed statistical models

but unfortunately that models neglect some factors such as border and continuity,

shadow and non-uniform reflectance. That’s why for some cases, manual way produce

better result that statistical approach.

Most popular automated approach is by Nobuyuki Otsu [24], using function

graytresh that choose the threshold to minimize the intra class variance (within class) of

the black and white pixels. Otsu’s thresholding perform iterating through all the possible

threshold values and calculating a measure of spread for the pixel levels each side of the

threshold. It wants to find the threshold value where the sum of foreground and back

ground spreads is at minimum. There are equations for calculating between class

variance and within class variance to find the threshold, as follow equation:

Within class variance:

𝜎2𝑊 = 𝜔0𝜎2

0 + 𝜔1𝜎21

Between class variance:

𝜎2𝐵 = 𝜔0(𝜇0 − 𝜇𝑟)2 + 𝜔1(𝜇1 − 𝜇𝑟)2 = 𝜔0𝜔1(𝜇1 − 𝜇0)2

Where 𝜇 = 𝜔0𝜇0 + 𝜔1𝜇1

In this project, the most prominent colour to qualitatively and quantitatively

differentiate between RBC and its background is Green channel. Green channel is used

because it has the best contrast between RBC and background [1]. The threshold value is

ranged from value 0 until 255 and among this values, the most significant threshold that

matches for the whole sample is in range of 145 to 148 (Figure 3.5).

(2)

(3)

Page 30: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

20

Figure 3.5: Threshold value setting

A testing has been done to select the correct channel to be used. By using img2,

the actual count for RBC number that manually derived is 82. From Table 3.1, it can be

seen that measurement in channel Red gave the lowest number from the actual count. As

comparison, channel Green and Blue produced the close number to the actual. If Red

channel is selected, the threshold value needs to be higher so that the image can be

differentiated quite clear from the background.

Table 3.1: Comparison of each RGB channel for thresholding purpose

Channel Threshold value Measured count

Red 178 67

Green 148 81

Blue 148 80

Page 31: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

21

(a) Green channel

(b) Red channel

(c) Blue channel

Figure 3.6: Comparison of threshold images in different RGB channels

Page 32: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

22

Figure 3.6 show the comparison images in each RGB channel. The set threshold

is 148 for all channels. However, when channel Red is set at 148, the result shows the

blank image, only WBCs are appeared. It is meaning the RBC images are not

differentiated from the background. That is the reason channel Red is not selected. This

gives the idea that red channel can be used in order to eliminate WBC but need to be

applied with marker and masking technique.

Thus, channel Green and Blue are suitable to be used. However channel Green

is most prominent for differentiating the foreground and background because the

measurement for all images showed that Green channel tresholding gave better results

compared to Blue channel.

3.1.2.2 Morphological operations

After thresholding process, the next step is to edit or ‘make up’ the image by

using several morphological operations. Morphological functions can improve the

information in a binary image by removing unwanted information such as noise

particles, particles touching the border of images, particle touching each other or particle

with uneven borders. Morphological operations rely only on the relative ordering of

pixels values not the numerical values. Therefore it especially suited to the processing

on binary images and also greyscale images. That is why the conversion of the RGB

image into binary is essential in the image processing.

In this case, the function of NI Vision Assistant is involved. In MATLAB, the

algorithm of morphological operation is quite similar. Since the focus is on the RBC as

the objects, the incomplete shaped RBC or such as attached to the border line will be

ignored. “Remove border” means eliminating the particles that touch to the image

border.

Page 33: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

23

The process followed by “fill holes” which is to fill the holes in the RBC images.

The morphological operation for that is closing, which is similar in some ways to

dilation is as expressed in equation (4):

𝐴 ∙ 𝐵 = (𝐴 ⊕ 𝐵) ⊖ 𝐵

It tends to enlarge the boundaries of foreground regions in an image and shrink

background colour holes in such regions but it is less destructive of the original

boundary shape. Holes are filled with the pixel value of 1. The holes are appeared due to

the hemoglobin in the RBC. Thresholding process will leave some of the inner RBC area

become hollow. It needs to be filled up because in the classification stage, area in the

RBC image will be considered.

Besides, the small objects also can be noise that has to be cleared. They come

from platelet area or the imperfection of background identification after thresholding

process. “Remove small objects” is to diminish such noise by erosion many times

(iterations). The morphological operation for that process is opening, which the basic

effect is somewhat like erosion as expressed in equation (5):

𝐴 ∘ 𝐵 = (𝐴 ⊖ 𝐵)⨁𝐵

Erosion is to shrink or thin the binary image. In other words is reducing or minus the

image pixel. This can be applied to eliminate unwanted objects.

“Equalize” is increasing the intensity dynamic by distributing a given grayscale

interval over the full grayscale. It redistributes pixel intensities on order to provide a

linear cumulated histogram.

Lastly, the image has to be in state where objects are in black and background is

in white for be fed into the next stage. Thus, “Reverse” is to reverse the pixel value and

produce the photometric negative of the original image. The outcome of the pre-

processing images will be shown in the Chapter 4.

(4)

(5)

Page 34: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

24

3.1.3 Segmentation and classification

Image segmentation and classification is the step for partitioning the images into

its main components. There are two basic properties for most segmentation algorithm

that can be extracted from pixel values, which are discontinuity and similarity or

combination of both. Many problems contribute challenges in segmentation such as non-

uniform, lighting, shadows, overlapping among objects, and poor contrast between

objects and background. The classification or detection stage is involving thresholding

(as in segmentation), particle analysis and binary morphology to locate area features that

match specific criteria that has been decided. Area features must have uniform pixel

intensities or colours that vary significantly from the background pixels.

Particle analysis consists of a series of processing operations and analysis

functions that produce some information about the particle in an image. A particle is a

contiguous region of non-zero pixels. Previously, the image has been extracted by

thresholding process into background and foreground states. Zero valued pixels are in

the background state and non-zero valued pixels are in the foreground. Particle analysis

is performed to detect connected regions or grouping of pixels in an image and then

make selected measurements of those regions. Hence, with this information, the features

can be detected in various part shape or orientation.

In a blood image, there is condition where cells might be overlapped or clumped

more than two cells. To overcome that matter, this project classifies the RBC features

into single (non-overlap) and multi-overlapped cells, which overlapped condition is

could be into double cells, triple cells and more than three cells. The classification and

detection of objects with those features will be done based on the area of the particle.

Particle is defined here as RBC image and area is the number of pixels within the image.

Hence, the area in the RBC is determined in the certain range for single and others.

As shown in Table 3.2, RBC is ranged based on the particle area in pixels. The

pixels value below than 5000 is neglected since it might be non-RBC component such as

platelet or any noise that missed to be extracted out in the early process. Maximum

pixels value is 300000 and upper than that might be the overlapping cells more than four

or could be any larger component other than RBC.

Page 35: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

57

REFERENCES

[1] Tomari, R., Wan Zakaria, W. N., Abdul Jamil, M. M., Mohd Nor, F. and Nik

Fuad, N. F., Computer Aided System for Red Blood Cell Classification in Blood

Smear Image, Procedia Computer Science, vol 42,pp. 206-213, 2014

[2] Ajay P. Dhawale and S. R. Hirekhan, Real- Time Image Processing for

Biological Applications Through Morphological Operations using LabVIEW ,

International Journal of Engineering research & Technology (IJERT), vol. 3

issue 5, May 2014.

[3] Venkatalakshmi, B. and Thilagavathi, K. Automatic Red Blood Cell Counting

using Hough Transform, IEEE Conference on Information & Communication

Technologies (ICT), 2013.

[4] Adagale, S.S. and Pawar, S.S. Image Segmentation using PCNN and Template

Matching for Blood Cell Counting, IEEE International Conference on

Computational Intelligence and Computing Research, pp. 1-5, 2013.

[5] Mahmood, N.H. Poon C.L., Mazalan, S.M. and Abdul Razak, M. A. Blood

Cells Extraction using Color Based Segmentation Technique, International

Journal of Life Science Biotechnology and Pharma Research, Vol.2 No. 2, pp.

233-240, April 2013.

Page 36: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

58

[6] Tusani, H., Saxena, S. and Yadav, N. Segmentation using Morphological

Watershed Transformation for Counting Blood Cells. International Journal of

Computer & Information Technology. Vol (2). Issue III. Apr-May 2013.

ISSN:2278-7720. Pp.28-36.

[7] Sharif, J. M., Miswan, M. F., Ngadi, M. A., Salam, M. S. and Abdul Jamil, M.

M., Red Blood Cell Segmentation Using Masking and Watershed Algorithm: A

Preliminary Study, International Conference of Biomedical Engineering (IcoBE),

Penang Malaysia, 27-28 February 2012.

[8] Cai, R., Wu, Q., Zhang, R., Fan, L. and Ruan, C. Red Blood Cell Segmentation

using Active Appearance Model, IEEE 11th

International Conference on Signal

Processing, pp. 1641-1644, Vol. 3, 2012.

[9] Berge, H., Taylor, D., Krishnan, S. and Douglas, T.S. Improved Red Blood

Cells Counting in Thin Blood Smear, IEEE- ISBI, pp.204-207, 2011.

[10] Jambhekar, N. J. Red Blood Cells Classification using Image Processing,

Science Research Reporter, 1(3): p151-154, November 2011.

[11] Wang, R., MacCane, B. and Fang, B. RBC Image Segmentation based on

Shape Reconstruction and Multi-scale Surface Fitting, 3rd

International

Symposium of Information Science and Engineering, pp. 586-589, 2010.

[12] Nguyen, N-T., Duong A-D. and Vu, H-Q. A New Method for Splitting Clumped

Cells in Red Blood Images, 2nd

International Conference on Knowledge and

System Engineering, Ho Chi Minh Vietnam, 2010.

[13] Huang J., An Improved Algorithm of Overlapping Cell Division, Intelligent

Computing and Integrated System, International Conference of Digital Object

Identifier, pp. 687-691, 2010.

Page 37: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

59

[14] Fox, S.I. Human Physiology, Mc Graw Hill International Ed., 11th

Ed., New

York, 2009.

[15] Vromen, J. and McCane, B. Red Blood Cell Segmentation from SEM Images,

24th

International Conference Image and Vision Computing, New Zealand, 2009.

[16] Wei, X., S.H. Ong, C. Kang, Joo H. L., Jiang, L., D. Racoceanu and K. Foong,

Cell Clumping Qualification and Automatic Area Classification in Peripheral

Blood Smear Image, IEEE , 2009.

[17] Natsution A.M.T, and Suryaningtyas, E.K. Comparison of Red Blood Cells

Counting using two Algorithms: Connected Component Labelling and

Backprojection of Artificial Neural Network, IEEE, Singapore, pp. 1-4, 2008.

[18] Poomcokrak, J. and Neatpisarnvanit, C. Red Blood Cells Extraction and

Counting, The 3rd

International Symposium on Biomedical Engineering, 2008.

[19] Wang, R. and MacCane, B. Red Blood Cell Classification Through Depth Map

and Surface Feature, International Symposium on Computer Science and

Computational Technology, pp. 339-342, 2008.

[20] D.R. Caprette, “Introduction Laboratory : using a counting chamber,” Bios211,

2007.

[21] D. Goyal., Thesis on Diagnosis Disease System using LabView, Thapar Institute

of Engineering and Technology (Deemed University) Patiala, June 2006.

[22] Waters, J. C. Chapter 5- An Introduction to Electronic Image Acquisition during

Light Microscopic Observation of Biological Specimens. Cell Biology. 2006.

Elsevier Science (USA). pp. 49-56.

[23] H. Rhody, Lecture 10:Hough Circle Transform,Chester F. Carlson Center for

Imaging Science, Rochester Institute of Technology, 2005.

Page 38: AUTOMATIC RED BLOOD CELL COUNTING BASED ON …eprints.uthm.edu.my/7833/1/RABIAHTULADAWIAH_BINTI_MUSA.pdf · Dalam bidang perubatan, analisis dan pengiraan sel darah merah menyumbangkan

60

[24] Webster, J.G. and Cazzanti, S.C. Bioinstrumentation-Hematology, John Wiley

& Sons, Inc., 2004, ISBN978-0-471-26327-2, pp.170-188.

[25] Otsu, N., A Threshold Selection Method from Gray-Level Histogram. IEEE

Transaction on System, Man and Cybernetics, Vol. 9, No. 1, 1979.pp. 62-66.

[26] RBC image. Retrieved from http://vikaspedia.in/health/diseases/genetic-

disorders/sickle-cell-disease on Jun 2015.