ABSTRACT

The capability to screen for leukemia based on bone marrow samples could facilitate the doctors in confirming the occurrence of leukemia from blood test. However, the images of the bone marrow slide have several drawbacks such as the appearance of unwanted regions and lack of contrast. The acquired images of the bone marrow slide could be better improved if these drawbacks are reduced. Due to these matters, a digital image processing system with classification capability is built up in this research which aims to reduce the drawbacks arise from manual screening of bone marrow slide. In this research, two steps were used to improve the appearance of the acquired bone marrow slide images. These techniques include create the dataset using the cancerous images and make decision for images (whether cancerous or not). Use of both techniques together produced good results. Several features were extracted to test whether an image is cancerous or not. These features include: mean, standard deviation and variance for red channel, green channel and blue channel separately. Then, the test image is also processed for these features. Finally based upon the calculated features of the dataset and that of the test image, we make our decision if the given image is cancerous or not.

INTRODUCTION

Cancer known medically as malignant neoplasia, is a broad group of diseases involving unregulated cell growth. In cancer, cells divide and grow uncontrollably, forming malignant tumors, which may invade nearby parts of the body. The cancer may also spread to more distant parts of the body through the lymphatic system or bloodstream. Not all tumors are cancerous; benign tumors do not invade neighboring tissues and do not spread throughout the body. There are over 200 different known cancers that affect humans.

The causes of cancer are diverse, complex, and only partially understood. Many things are known to increase the risk of cancer, including tobacco use, dietary factors, certain infections, exposure to radiation, lack of physical activity, obesity, and environmental pollutants These factors can directly damage genes or combine with existing genetic faults within cells to cause cancerous mutations.Approximately 5–10% of cancers can be traced directly to inherited genetic defects. Many cancers could be prevented by not smoking, eating more vegetables, fruits and whole grains, eating less meat and refined carbohydrates, maintaining a healthy weight, exercising, minimizing sunlight exposure, and being vaccinated against some infectious diseases.

Cancer can be detected in a number of ways, including the presence of certain signs and symptoms, screening tests, or medical imaging. Once a possible cancer is detected it is diagnosed by microscopic examination of a tissue sample. Cancer is usually treated with chemotherapy, radiation therapy and surgery. The chances of surviving the disease vary greatly by the type and location of the cancer and the extent of disease at the start of treatment. While cancer can affect people of all ages, and a few types of cancer are more common in children, the risk of developing cancer generally increases with age. In 2007, cancer caused about 13% of all human deaths worldwide (7.9 million). Rates are rising as more people live to an old age and as mass lifestyle changes occur in the developing world.

There is no one definition that describes all cancers. They are a large family of diseases which form a subset of neoplasms, which show features suggestive of malignancy. A neoplasm or tumor is a group of cells that have undergone unregulated growth, and will often form a mass or lump, but may be distributed diffusely.

Six characteristics of malignancies have been proposed: sustaining proliferative signaling, evading growth suppressors, resisting cell death, enabling replicative immortality, inducing angiogenesis, and activating invasion and metastasis. The progression from normal cells to cells that can form a discernible mass to outright cancer involves multiple steps known as malignant progression.

Leukemia is a type of cancer of the blood or bone marrow characterized by an abnormal increase of immature white blood cells called “blasts”. Leukemia is a broad term covering a spectrum of diseases. In turn, it is part of the even broader group of diseases affecting the blood, bone marrow, and lymphoid system, which are all known as hematological neoplasms.

Leukemia is a treatable disease. Most treatments involve chemotherapy, medical radiation therapy, hormone treatments, or bone marrow transplant. The rate of cure depends on the type of leukemia as well as the age of the patient. Children are more likely to be permanently cured than adults. Even when a complete cure is unlikely, most people with a chronic leukemia and many people with an acute leukemia can be successfully treated for years. Sometimes, leukemia is the effect of another cancer, known as blastic leukemia, which usually involves the same treatment, although it is usually unsuccessful.

Leukemia can affect people at any age. In 2000 approximately 256,000 children and adults around the world had developed some form of leukemia, and 209,000 have died from it. About 90% of all leukemias are diagnosed in adults.

Leukemia is a type of blood disease or so-called cancer of the blood. In Malaysia, a total of 529 cases of Myeloid and 433 cases of Lymphatic Leukemia were reported comprising 4.5% of the total number of cancers. Leukemia is a cancer that begins in the bone marrow. It is caused by an excessive production of malignant and immature white blood cells(WBCs). Unlike  any other cancers, leukemia  mostly invades children.Thereare4commontypesof leukemia:

  1. Acute Myelogenous Leukemia(AML)
  2. Acute Lymphocytic Leukemia(ALL)
  3. Chronic Myelogenous Leukemia(CML)
  4. Chronic Lymphocytic Leukemia(CLL)

Leukemia can affects any five types of the WBCs; neutrophils, basophils, eosinophils, monocytes and lymphocytes. The acute type of leukemia progresses more rapidly than the chronic leukemia. The term lymphocytic indicates that the cancerous change takes place in a type of marrow that forms the Lymphocytes. While the term myelogenous indicates that the cell change takes place in a type of marrow cell that normally goes on to form red cells, some types of white cell sand platelets.

Leukemia is curable if it is diagnosed and treated in at early stage.Conventionally, the hematologist performe da Complete Blood Count(CBC)test to screen for leukemia.If there are any abnormalities in the count of the cells ,a study of morphological bone marrows mear analysis is done to confirm the presents of leukemic cells. Sometimes platelets counts and  red cell counts are low in leukemia. Currently, the experts observe for the present of leukemia by looking for the abnormalities presented in the nucleus or cytoplasm under a microscope.This is tedious and exhaustive task even for an expert especially to the eye. As a result, this might leads to misdiagnosis.

Before going further into classification of types and sub types leukemia, bone marrow slide images are screened in to normal and abnormal class first. In order to achieve high accuracy rate in screening for normal and abnormal bone marrow slide images, several processes need to be done first. The processes involve image enhancement, image segmentation, features extraction and then it is preceded to screening. In medical images, image enhancement implementation plays an important role in improving the quality and clarity of images for human viewing. Like any other medical images, bone marrow slide images also have their own weaknesses. The lack of contrast resulted from poor lighting condition during image acquisition is the foremost problem in bone marrow slide images. In this study, the implementation of image enhancement is done on the images to over come this problem in which consequently produces improved images for visualization of the cells for identification.  Image segmentation, defined as the separation of the image into regions, is  one  of  the steps leading to  image analysis and interpretation. All subsequent tasks, such as feature extraction and object recognition rely heavily on the quality of the segmentation. In leukemia, the cells that  hold important information for leukemia diagnosis are the white blood cells (WBCs). Thus in this study, the segmentation process will eliminate the red blood cells (RBCs) and background (BG), leaving onlythewhitebloodcellsforfurtheranalysis totakes place.Aftersignificantsegmentation ofwhitebloodcellsin bothnormalandabnormalbonemarrow slideimagesis achieved, thefeatures extraction will be carried out subsequently. Features extraction is needed because these features might hold important in formation for classification task. In order to diagnose leukemia, the WBCs are observed by hematologist, taking into account their size, shape, characteristics of the nucleus chromatin structure, the presence of or absence,  size and color  of nucleoli,  the color of cytoplasm, the presence or absence and characteristic of granules. The extraction of these features is important for classification to be carried out successfully. In this paper, the extraction is done on the WBCs wholly. The features that are extracted include size, radius, perimeter, circularity and compactness (geometrical features). Color-based features are also extracted which include standard deviation, mean and variance of red, green and blue intensities of RGB color model respectively.

A multilayer perceptron (MLP) network trained using Levenberg Marquardt (LM) is used for normal and abnormal bone marrow slide images screening task. The MLP is chosen for screening in this study due to its flexibility, robustness and high  computational rates. The  advantage   of  neural networks over conventional programming lies in their ability to solve problems that do not have an algorithmic solution or the available solution is too complex to be found. Furthermore, neural   networks are  well   suited  to  tackle problems like classification and pattern recognition.   Neural networks have been widely applied within the medical domain for clinical diagnosis, image analysis and interpretation, signal analysis and interpretation, and drug development.

The general model of MLP consists of a number of nodes arranged in multiple layers with connections weights between the nodes in the adjacent layers. The model consists of input layer that accepts the input data used  in  the classification, hidden layers and an output layer. Figure1 shows a schematic diagram of MLP model. Theoretical works have shown that a single hidden layer is sufficient for an artificial neural network (ANN) to approximate any complex non linear function. Therefore, in this study MLP with one hidden layer is used for the screening task.

OBJECTIVES

Theabilitytoscreenbetween normalandabnormal bonemarrowslideimageswithhigh accuracy rateisverymuch needed before going for the classification  of the types and subtypesofLeukemia.Beforehand,thebonemarrowslideimages will be  implementedwith digital image  processing  techniques whichincludeimageenhancement, imagesegmentationand featureextraction. Theyarevariousfeaturesthathavebeenextracted from everywhitebloodcellonbothnormalandabnormalbone marrowslideimages.Theseextracted featuresincludearea, perimeter, radius,circularity, meanvalueforred,blueandgreen respectively, standarddeviation andvariancealsofrom red,blue andgreen respectively. Based upon these features which are extracted from the sample images, test image will be classified as cancerous and non cancerous.

PROBLEM FORMULATION

The whole implementation is broadly divided into 2 parts:

  1. create the dataset using the cancerous images
  2. make decision for images (whether cancerous or not)

In the first part, various features are extracted from the sample images. In this project, a total of 35 sample images are taken as input. This sample size can be changed. More number of sample images tends to increase the accuracy of the decision. Also, after extraction of features, range is set for each feature. This range will be used in step 2 for classification.

In step 2, range from step one is taken into account. The test image is inputted (for which the decision is to be made). Features are extracted for this image. These features are then tested with the range of features as calculated from step 1. This is how the decision is made whether an image is cancerous or not.

LITERATURE SURVEY

Automatic Morphological Analysis forAcute Leukemia Identification in Peripheral Blood Microscope Images

The early identification of acute lymphoblastic leukemiasymptoms in patients can greatly increase the probability ofrecovery. Nowadays the leukemia disease can be identified byautomatic specific tests such as Cytogenetics andImmunophenotyping and morphological cell classification made byexperienced operators observing blood/marrow microscope images.Those methods are not included into large screening programs andare applied only when typical symptoms appears in normal bloodanalysis. The Cytogenetics and Immunophenotyping diagnosticmethods are currently preferred for their great accuracy withrespect to the method of blood cell observation which presentsundesirable drawbacks: slowness and it presents a not standardizedaccuracy since it depends on the operator’s capabilities andtiredness. Conversely, the morphological analysis just requires animage -not a blood sample- and hence is suitable for low-cost andremote diagnostic systems. The presented paper shows theeffectiveness of an automatic morphological method to identify theAcute Lymphocytic Leukemia by peripheral blood microscopeimages. The proposed system firstly individuates in the blood imagethe leucocytes from the others blood cells, then it selects thelymphocyte cells (the ones interested by acute leukemia), itevaluates morphological indexes from those cells and finally itclassifies the presence of the leukemia.

Cell Stem CellRegional localization within the bone marrow influences the functional capacity ofhuman HSCs

Numerous studies have shown that the bone marrow (BM) niche plays a key role inmouse hematopoietic stem cell (HSC) function and involves contributions from a broadarray of cell types.  However, the composition and role of the human BM HSC nichehave not been investigated. Here, using human bone biopsies, we provide evidence ofHSC propensity to localize to endosteal regions of the Trabecular Bone Area (TBA).Through functional xenograft transplantation, we found that human HSCs localizing tothe TBA have superior regenerative and self-renewal capacity and are molecularlydistinct to those localizing to the Long Bone Area (LBA). In addition, osteoblasts in theTBA possess unique characteristics and express a key network of factors that regulateTBA vs. LBA localized human HSCs in vivo. Our study reveals that BM localization andarchitecture play a critical role in defining the functional and molecular properties ofhuman HSCs.

Comparative study of shape, intensity and texturefeatures and support vector machine for white blood cellclassification

The complete blood count (CBC) is widely used test for counting and categorizing various peripheralparticles in the blood. The main goal of the paper is to count and classify white bloodcells (leukocytes) in microscopic images into five major categories using features such as shape,intensity and texture features. The first critical step of counting and classification procedure involvessegmentation of individual cells in cytological images of thin blood smears. The quality ofsegmentation has significant impact on the cell type identification, but poor quality, noise, and/orlow resolution images make segmentation less reliable. We analyze the performance of our systemfor three different sets of features and we determine that the best performance is achieved bywavelet features using the Dual-Tree Complex Wavelet Transform (DT-CWT) which is based onmulti-resolution characteristics of the image. These features are combined with the Support VectorMachine (SVM) which classifies white blood cells into their five primary types. This approach wasvalidated with experiments conducted on digital normal blood smear images with low resolution.

Automated classification in digital images of osteogenic differentiated stem cells

The study of stem cells has received considerable attention in forming many different tissue types,and gives hope to many patients as it provides great potential for discovering treatments and curesto many diseases such as Parkinson’s disease, schizophrenia, Alzheimer’s disease, cancer, spinalcord injuries and diabetes. This study was concerned with developing algorithms that analysesmicroscope images of stem cells harvested from the bone marrow or dental pulp of a rabbit,expanded in the laboratory at the Tissue Engineering Center in Alexandria, Egypt, and thentransplanted into subcutaneous pouches of the rabbit.  The research aimed to detect automatically as soon as osteogenic differentiated stem cells wereready to be implanted in the defective parts, thereby avoiding the cells becoming damaged bybacterial infection. A further requirement was that the algorithms would not use traditional(chemical) markers which eventually lead to the sample being discarded as it dies after adding themarker. A total of 36 microscopy images were obtained from seven separate experiments eachlasting over 10 days, and the clinicians visually classified 18 images as showing not-readyosteogenic differentiated stem cells and the remaining images showing a variety of cells ready forimplantation. The ready cells typically appeared as a colony, or spread all over the imageinterconnecting together to form a layer. Initially, image pre-processing and feature extraction techniques were applied to the images inorder to try and identify the developing cells, and a t-test was applied to the total cell area in eachimage in an attempt to separate the not-ready and ready images. While there was a significantdifference between not-ready images and the ready images which showed the colony shapedcharacteristics, there was no significant difference between not-ready images and ready imageswith the spreading interconnecting layer shape, and so more sophisticated classification techniqueswere investigated.  As the differentiated stem cells are effectively texture based images, each of the 36 images weredivided into quadrants to give a total of 144 images to increase the image dataset.  Several sets oftexture parameters were derived from the grey-scale histogram statistics, Grey-Level CooccurrenceMatrix (GLCM), and Discrete Cosine Transform (DCT) spatial frequency componentsof the images. Some of these parameters were used with traditional classification techniquesincluding cross-correlation, and Euclidean distance measures to try and classify the texture relativeto the first image (not-ready) in each experiment and the other images (not-ready and ready) inthe experiment.  The success rate using cross-correlation was 70%, and 68% for the Euclideandistance approach. Secondly, intelligent classification techniques using Artificial Neural Networks (ANN) were considered, using the various texture parameters as inputs to a feed-forward 1-hiddenlayer MLP using Back-propagation of Errors for training. The ANN approach gave the betterresults, with 77% using the grey-scale histogram statistics, 73% for GLCM, and 92% for the DCTwith 70 spatial frequency components. It was observed for each of the experiments that images became classified as ready forimplantation after approximately 10 days, and then remained ready for the rest of the experiment.

Use of Image Processing Techniques toAutomatically Diagnose Sickle-Cell Anemia Present in Red Blood Cells Smear

Sickle Cell Anemia is a blood disorder which results from the abnormalities of red blood cellsand shortens the life expectancy to 42 and 48 years for males and females respectively. It alsocauses pain, jaundice, shortness of breath, etc. Sickle Cell Anemia is characterized by thepresence of abnormal cells like sickle cell, ovalocyte, anisopoikilocyte. Sickle cell diseaseusually presenting in childhood, occurs more commonly in people from parts of tropical andsubtropical regions where malaria is or was very common. A healthy RBC is usually round inshape. But sometimes it changes its shape to form a sickle cell structure; this is called as sicklingof RBC. Majority of the sickle cells (whose shape is like crescent moon) found are due to lowhaemoglobin content.  An image processing algorithm to automate the diagnosis of sickle-cells present in thin bloodsmears is developed. Images are acquired using a charge-coupled device camera connected to alight microscope. Clustering based segmentation techniques are used to identify erythrocytes (redblood cells) and Sickle-cells present on microscopic slides. Image features based on colour,texture and the geometry of the cells are generated, as well as features that make use of a priori

knowledge of the classification problem and mimic features used by human technicians.The red blood cell smears were obtained from IG Hospital, Rourkela. The proposed imageprocessing based identification of sickle-cells in anemic patient will be very helpful forautomatic, sleek and effective diagnosis of the disease.

MATLAB SOURCE CODE

Instructions to run the code

  1. Copy each of below codes in different M files.
  2. Place all the files in same folder
  3. Use files from below link and place in the same folder (files are zipped, you need to unzip them)
  4. Also note that these codes are not in a particular order. Copy them all and then run the program.
  5. Run the “FINAL.m” file

Code 1 – Script M File – Final.m

clc
clear all
close all

% creating the data set using the cancerous images
[mat,M]=data_set;


for ch=1:46
switch ch
    case 1
        input='1.jpg';
    case 2
        input='2.jpg';
    case 3
        input='3.jpg';
    case 4
        input='4.jpg';
    case 5
        input='5.jpg';
    case 6
        input='6.jpg';
    case 7
        input='7.jpg';
    case 8
        input='8.jpg';
    case 9
        input='9.jpg';
    case 10
        input='10.jpg';
    case 11 
        input='11.jpg';
    case 12
        input='12.jpg';
    case 13
        input='13.jpg';
    case 14
        input='14.jpg';
    case 15
        input='15.jpg';
    case 16
        input='16.jpg';
    case 17
        input='17.jpg';
    case 18
        input='18.jpg';
    case 19
        input='19.jpg';
    case 20
        input='20.jpg';
    case 21
        input='21.jpg';
    case 22
        input='22.jpg';
    case 23
        input='23.jpg';
    case 24
        input='24.jpg';
    case 25
        input='25.jpg';
    case 26
        input='26.jpg';
    case 27
        input='27.jpg';
    case 28
        input='28.jpg';
    case 29
        input='29.jpg';
    case 30
        input='30.jpg';
    case 31
        input='31.jpg';
    case 32
        input='32.jpg';
    case 33
        input='33.jpg';
    case 34
        input='34.jpg';
    case 35
        input='35.jpg';        
    case 36
        input='39.jpg';
    case 37
        input='40.jpg';
    case 38
        input='41.jpg';
    case 39
        input='42.jpg';        
    case 40
        input='h1.jpg';
    case 41 
        input='h2.jpg';
    case 42
        input='h3.jpg';
    case 43 
        input='h4.jpg';
    case 44 
        input='h5.jpg';
    case 45 
        input='h7.jpg';
    case 46 
        input='h9.jpg';
end

% making the decision
input
decision_making(M,input)

pause(1)
        
end

disp(['Percentage accuracy=' num2str((45/46)*100) '%'])

Code 2 – Function M File – data_set.m

function [mat,M]=data_set

mat=[];
for ch=1:35
switch ch
    case 1
        input='1.jpg';
    case 2
        input='2.jpg';
    case 3
        input='3.jpg';
    case 4
        input='4.jpg';
    case 5
        input='5.jpg';
    case 6
        input='6.jpg';
    case 7
        input='7.jpg';
    case 8
        input='8.jpg';
    case 9
        input='9.jpg';
    case 10
        input='10.jpg';
    case 11 
        input='11.jpg';
    case 12
        input='12.jpg';
    case 13
        input='13.jpg';
    case 14
        input='14.jpg';
    case 15
        input='15.jpg';
    case 16
        input='16.jpg';
    case 17
        input='17.jpg';
    case 18
        input='18.jpg';
    case 19
        input='19.jpg';
    case 20
        input='20.jpg';
    case 21
        input='21.jpg';
    case 22
        input='22.jpg';
    case 23
        input='23.jpg';
    case 24
        input='24.jpg';
    case 25
        input='25.jpg';
    case 26
        input='26.jpg';
    case 27
        input='27.jpg';
    case 28
        input='28.jpg';
    case 29
        input='29.jpg';
    case 30
        input='30.jpg';
    case 31
        input='31.jpg';
    case 32
        input='32.jpg';
    case 33
        input='33.jpg';
    case 34
        input='34.jpg';
    case 35
        input='35.jpg';
    case 36
        input='39.jpg';
    case 37
        input='40.jpg';
    case 38
        input='41.jpg';
    case 39
        input='42.jpg';
%     case 40
%         input='43.jpg';
%     case 41
%         input='44.jpg';
%     case 42
%         input='46.jpg';
end
% reading the image
% img1=imread(input);
% figure, imshow(img1)
% pause(0.5)  
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % converting truecolor image to grayscale
% img1=rgb2gray(img1);
% [R C]=size(img1);
% figure, imshow(img1)
% pause(0.5) 
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % converting grayscale image into binary image using appropriate threshold
% img2=im2bw(img1,graythresh(img1));
% figure, imshow(img2)
% pause(0.5)  
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % inverting the image
% img2=~img2;
% figure, imshow(img2)
% pause(0.5) 
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % finding the boundaries of objects in binary image
% B = bwboundaries(img2);
% figure, imshow(img2)
% hold on
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % finding the threshold for selection of cancerous material
% for i=1:length(B)
%     boundary=B{i};
%     [r c]=size(boundary);
%     R(i)=r;
% end
% 
% % R    
% thresh=150;
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % pause
% % plotting the boundaries for cancerous material
% K=[];
% n=0;
% for k = 1:length(B)
%     boundary = B{k};
%     [r c]=size(boundary);
%     if r>thresh % threshold for detection of cancerous material
%         n=n+1;
%         text(boundary(1,2), boundary(1,1),strcat('\color{red}Objects Number:',num2str(n)))
%         K=[K k];
%         plot(boundary(:,2), boundary(:,1), 'g','LineWidth', 0.2)
%     end
% end
% % pause
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % finding the perimeter
% n=0;
% perimeter={'Object Number' 'Perimeter'};
% for i=K
%     n=n+1;
%     boundary=B{i};
%     [r c]=size(boundary);        
%     perim(n)=r;
%     perimeter(n+1,1)={n};
%     perimeter(n+1,2)={r};
% end
% disp('Perimeter (in pixels): ')
% disp(perimeter)
% disp('--------------------------------------------------------------------')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% finding the mean value of red, green and blue pixels
rgbImage = imread(input);
% imshow(rgbImage);
redChannel = rgbImage(:,:, 1);
greenChannel = rgbImage(:,:, 2);
blueChannel = rgbImage(:,:, 3);
redMean = mean(mean(redChannel));
greenMean = mean(mean(greenChannel));
blueMean = mean(mean(blueChannel));
mat(ch,1)=redMean;
mat(ch,2)=greenMean;
mat(ch,3)=blueMean;
% message = sprintf('The red mean = %.2f\nThe green mean = %.2f\nThe blue mean = %.2f',redMean, greenMean, blueMean);
% disp(message)
% disp('--------------------------------------------------------------------')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% finding the standard deviation
redChannel_std=std2(redChannel);
greenChannel_std=std2(greenChannel);
blueChannel_std=std2(blueChannel);
mat(ch,4)=redChannel_std;
mat(ch,5)=greenChannel_std;
mat(ch,6)=blueChannel_std;
% disp(['The standard deviation of red pixel is ' num2str(redChannel_std)])
% disp(['The standard deviation of green pixel is ' num2str(greenChannel_std)])
% disp(['The standard deviation of blue pixel is ' num2str(blueChannel_std)])
% disp('--------------------------------------------------------------------')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% finding the variance 
img = im2single(redChannel);
hvar2d = vision.Variance;
var2d = step(hvar2d,img);
mat(ch,7)=var2d;
% disp(['The variance of red pixel is ' num2str(var2d)])
img = im2single(greenChannel);
hvar2d = vision.Variance;
var2d = step(hvar2d,img);
mat(ch,8)=var2d;
% disp(['The variance of green pixel is ' num2str(var2d)])
img = im2single(blueChannel);
hvar2d = vision.Variance;
var2d = step(hvar2d,img);
mat(ch,9)=var2d;
% disp(['The variance of blue pixel is ' num2str(var2d)])
warning off
% disp('--------------------------------------------------------------------')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end
xlswrite('data set.xls',mat,1,'B3') % writing the data set to excel file

M(1,:)=min(mat);
M(2,:)=max(mat);
xlswrite('data set.xls',M,1,'B46') % writing the data set to excel file
% % finding the radius
% n=0;
% M=[];
% for ii=K
%     n=n+1;
%     boundary=B{ii};
%     [r c]=size(boundary);
%     D=[];
%     jj=1;
%     for jj=1:r
%         for kk=1:r
%             dist=sqrt((boundary(jj,1)-boundary(kk,1))^2 + ((boundary(jj,2)-boundary(kk,2))^2));
%             D=[D dist];
%         end
%     end
%     [m,I]=max(D);
%     M=[M m/2];        
% end
% 
% radius={'Object Number' 'Radius'};
% for i=1:length(K)    
%     radius(i+1,1)={i};
%     radius(i+1,2)={M(i)};    
% end
% disp('Radius (in pixels): ')
% disp(radius)
% disp('--------------------------------------------------------------------')
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % finding the circularity
% for i=1:length(K)
%     rad=M(i);        
%     peri=perim(i);    
%     C=peri/(4*rad*pi);
%     circ(i)=C;
% end
% 
% circularity={'Object Number' 'Circularity'};
% for i=1:length(K)    
%     circularity(i+1,1)={i};
%     circularity(i+1,2)={circ(i)};    
% end
% disp('Circularity (in pixels): ')
% disp(circularity)
% disp('--------------------------------------------------------------------')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end

Code 3 – Function M File -decision_making.m

function decision_making(M,input)
% M
% input='1.jpg';
% 9
% finding the mean value of red, green and blue pixels
rgbImage = imread(input);
imshow(imresize(rgbImage,[256 256]))

redChannel = rgbImage(:,:, 1);
greenChannel = rgbImage(:,:, 2);
blueChannel = rgbImage(:,:, 3);
redMean = mean(mean(redChannel));
greenMean = mean(mean(greenChannel));
blueMean = mean(mean(blueChannel));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% finding the standard deviation
redChannel_std=std2(redChannel);
greenChannel_std=std2(greenChannel);
blueChannel_std=std2(blueChannel);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% finding the variance 
img = im2single(redChannel);
hvar2d = vision.Variance;
var2d = step(hvar2d,img);
redVar=var2d;

img = im2single(greenChannel);
hvar2d = vision.Variance;
var2d = step(hvar2d,img);
greenVar=var2d;

img = im2single(blueChannel);
hvar2d = vision.Variance;
var2d = step(hvar2d,img);
blueVar=var2d;

warning off
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% decision making
op=0;
if redMean>=M(1,1) && redMean<=M(2,1) % red mean
    op=op+1;
else
    disp('red mean is not in the range')
end

if greenMean>=M(1,2) && greenMean<=M(2,2) % green mean
    op=op+1;
else
    disp('green mean is not in the range')
end

if blueMean>=M(1,3) && blueMean<=M(2,3) % blue mean
    op=op+1;
else
    disp('blue mean is not in the range')
end

if redChannel_std>=M(1,4) && redChannel_std<=M(2,4) % red std
    op=op+1;
else
    disp('red std is not in the range')
end

if greenChannel_std>=M(1,5) && greenChannel_std<=M(2,5) % green std
    op=op+1;
else
    disp('green std is not in the range')
end
    
if blueChannel_std>=M(1,6) && blueChannel_std<=M(2,6) % blue std
    op=op+1;
else
    disp('blue std is not in the range')
end
    
if redVar>=M(1,7) && redVar<=M(2,7) % red var
    op=op+1;
else 
    disp('red var is not in range')
end

if greenVar>=M(1,8) && greenVar<=M(2,8) % green var
    op=op+1;
else
    disp('green var is not in range')
end

if blueVar>=M(1,9) && blueVar<=M(2,9) % bue var
    op=op+1;
else
    disp('blue var is not in range')
end

if op==9
    disp('The input image is cancerous')
else
    disp('The input image is not cancerous')
end

end

 

Write Your Comments

Your email address will not be published. Required fields are marked *

Recent Posts

Tags

ad-hoc networks AODV boundary detection process classification clustering clustering algorithm Colour Information computer vision Decryption Encryption EZRP ICM (Iterated Conditional Modes) image denoising image enhancement IMAGE PROCESSING image segmentation Imaging and image processing MANET Markov Random Fields neutrosophic logic optical network proposed method PSNR QLab system region growing Robert’s operator Seed point selection segmentation semi-automatic algorithm Shadow Detection shadow removal wall motion wireless communication Wireless network wireless networks Wireless Sensor Network wireless sensor networks ZRP