One of the important application in image processing is to be able to judge the different edges in an image and be able to distinguish various parts of it. Clearly, this is an application dependent task and results and analysis will vary as per the situation.
These slides show a general description on how to calculate the number of cells in a microscopic tissue. There are two version one being the over-stained tissue and the other being the better one. We see how the algorithm is able to calculate the number of cells.
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Cell calculation
1. A N I R U D H M U N N A N G I
D A V I D D R A K E
Thresholding and Counting
2. Overview
Objectives
Background
Matlab
Importing the Image
Thresholding
Inverse Mapping
Image Subtraction
Counting the Number of Cells
Conclusion
3. Objectives
Segment cells from the background media in a
digitized microscopy slide image using a basic
thresholding technique
Count the total amount of cells segmented from the
background media
4. Background
Basic Thresholding
Background pixels have intensity values grouped into two
dominant modes
Select a threshold, T, that separates these modes
Segmented image:
Tyxfif
Tyxfif
yxg
),(
),(
0
1
),(
(Gonzalez & Wood, 2008)
5. Background
Global Thresholding
1. Select an initial estimate for the global threshold, T
2. Segment the image using the previous equation
3. Compute the average (mean) intensity values m1 and m2 for
the pixels G1 and G2, respectively
4. Compute a new threshold value:
5. Repeat steps 2 through 4 until optimum threshold
determined
(Gonzalez & Wood, 2008)
)(
2
1
21 mmT
6. Background
Otsu’s Method
Digital image with M x N pixels has {0, 1, 2, …., L – 1} Intensity Levels
Normalized histogram
T(k) = k, 0 < k < L-1; separate pixels into two classes C1 and C2
Probability that a pixel is assigned to class C1 and C2
The mean intensity value of the pixels assigned to C1 and C2
(Gonzalez & Wood, 2008)
NMnp ii / 0,1
1
0
i
L
i
i pp
k
i
ipkP
0
1 )( )(1)( 1
1
1
2 kPpkP
L
ki
i
k
i
iip
kP
km
01
1
)(
1
)(
1
12
2
)(
1
)(
L
ki
iip
kP
km
7. Background
Otsu’s Method
Evaluate k using normalized, dimensionless metric
Introduce variable k into the previous equation
Obtain maximum threshold value k*, by maximizing σ2
B, then apply to basic
thresholding equation
2
2
G
B
)1(
)(
11
2
12
PP
mPmG
B
1
0
2
.
2
)(
L
i
iGG pmi
2
2
)(
)(
G
B k
k
))(1)((
)]()([
11
2
12
kPkP
kmkPmG
B
(Gonzalez & Wood, 2008)
)(max*)( 2
10
2
kk B
Lk
B
*),(
*),(
0
1
),(
kyxfif
kyxfif
yxg
8. Importing the Images
In Matlab:
img_gs=imread('Normal1.jpg'); %Load the image
figure
imshow(img_gs); %Plot the original image
title('Original Image: Grayscale');
12. Thresholding
Due to cell staining and digitization of the
microscopy slides, the corners of the slides were
darkened towards the color of the individual cells
This will cause tremendous error in our counting
algorithm, so it must be removed using inverse
mapping and image subtraction
13. Inverse Mapping
In Matlab:
imginv=~img_t; %Take the inverse of the binary map
figure
imshow(imginv); %Plot the inversed binary image
title('Threshold Image-Color Inverted');
15. Image Subtraction
In Matlab:
%Find large connected parts
subimg=bwareaopen(imginv,400);
%Best approximation of threshold is 400 after trial and error
figure
imshow(subimg); %Plot the image
title('image after small pixels removed');
17. Image Subtraction
In Matlab:
%Subtract the corners from the inverse binary map
newimg=imginv-subimg;
figure
imshow(newimg); %Plot the image
title('Image of the individual cells);
19. Counting the Number of Cells
Important to approximate the exact number of cells
Results will be used in a statistical analysis comparing repaired
tissue with controls
Counting error will most likely occur
How much fluorescence is absorbed by the cells determines
the appropriate threshold parameter (some cells excluded)
Elimination of the corner areas (more exclusion of cells)
Each slide differs in the amount of staining
20. Counting the Number of Cells
In Matlab:
%Count the number of cells by finding groups of largely
%connected pixels
b=bwboundaries(img_t);
figure
hold on
imshow(img_t); %Plot the image
title('Threshold Image-Color Inverted');
text(10,10, strcat('color{green}Objects Found:', …
num2str(length(b)))); %Add count no. to image
hold off
21. Counting the Number of Cells
Threshold Image-Color Inverted of the Original Tissue Section
Objects Found:668
22. Counting the Number of Cells
Threshold Image-Color Inverted of the Repaired Tissue Section
Objects Found:1667
23. Conclusion
Algorithm successfully thresholds and counts cells
from a digitized microscopy slide, thus able to show
that repaired tissue sections show more cells than
original tissue sections
Future work
Approximation of the cell count percent error
Automation for calculating the threshold parameter
(i.e Global thresholding)
Applying different thresholding algorithms
(i.e. Otsu’s method)