SlideShare a Scribd company logo
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
Overview
 Objectives
 Background
 Matlab
 Importing the Image
 Thresholding
 Inverse Mapping
 Image Subtraction
 Counting the Number of Cells
 Conclusion
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
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)
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
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
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
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');
Importing the images
X: 349 Y: 270
Index: 173
RGB: 0.529, 0.529, 0.529
Original Image: Grayscale
X: 456 Y: 546
Index: 171
RGB: 0.514, 0.514, 0.514
X: 746 Y: 388
Index: 176
RGB: 0.553, 0.553, 0.553
Thresholding
 In Matlab:
ith=175/255; %Determine threshold by cursor
img_t=im2bw(img_gs,th); %Convert to binary
figure
imshow(img_t); %Plot the image
title('Thresholded Image');
Thresholding
Thresholded Image
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
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');
Inverse Mapping
Threshold Image-Color Inverted
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');
Image Subtraction
image after small pixels removed
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);
Image Subtraction
Image of the individual cells
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
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
Counting the Number of Cells
Threshold Image-Color Inverted of the Original Tissue Section
Objects Found:668
Counting the Number of Cells
Threshold Image-Color Inverted of the Repaired Tissue Section
Objects Found:1667
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)
References
 Gonzalez, R.C, Woods, R.E., Digital Image
Procesing, 3rd Edition, Pearson Prentice Hall, 2008.
 Images obtained from bioinstrumentation lab UC

More Related Content

PPTX
Find nuclei in images with U-net
PPTX
Seismic data analysis with u net
PDF
METHOD FOR A SIMPLE ENCRYPTION OF IMAGES BASED ON THE CHAOTIC MAP OF BERNOULLI
PPTX
Improving access to satellite imagery with Cloud computing
PDF
A Framework of Secured and Bio-Inspired Image Steganography Using Chaotic Enc...
PPTX
Semantic Segmentation on Satellite Imagery
PPTX
Accelerated Logistic Regression on GPU(s)
PDF
Toy Model Overview
Find nuclei in images with U-net
Seismic data analysis with u net
METHOD FOR A SIMPLE ENCRYPTION OF IMAGES BASED ON THE CHAOTIC MAP OF BERNOULLI
Improving access to satellite imagery with Cloud computing
A Framework of Secured and Bio-Inspired Image Steganography Using Chaotic Enc...
Semantic Segmentation on Satellite Imagery
Accelerated Logistic Regression on GPU(s)
Toy Model Overview

What's hot (18)

PDF
J waters sab_poster_2
PDF
Reversible Data Hiding in the Spatial and Frequency Domains
PDF
Efficient Technique for Image Stenography Based on coordinates of pixels
PDF
K means clustering
PDF
Gpu based-image-quality-assessment-using-structural-similarity-(ssim)-index
PDF
Enhanced Human Computer Interaction using hand gesture analysis on GPU
PDF
Deep Learning for Computer Vision: Saliency Prediction (UPC 2016)
PDF
Centernet
PDF
Background Subtraction Based on Phase and Distance Transform Under Sudden Ill...
PDF
Pyclustering tutorial - K-means
PDF
Census and spatial data in sql server 2008 designing tools for hazard mitigat...
PDF
Clustering lect
PDF
AN ENHANCED SEPARABLE REVERSIBLE DATA HIDING IN ENCRYPTED IMAGES USING SIDE M...
PDF
2013.10.24 big datavisualization
PDF
Master defence 2020 - Vadym Korshunov - Region-Selected Image Generation with...
PDF
Machine Status Prediction for Dynamic and Heterogenous Cloud Environment
PDF
The International Journal of Engineering and Science (The IJES)
PPTX
Yonsei Data Science Lab - Computer Vision
J waters sab_poster_2
Reversible Data Hiding in the Spatial and Frequency Domains
Efficient Technique for Image Stenography Based on coordinates of pixels
K means clustering
Gpu based-image-quality-assessment-using-structural-similarity-(ssim)-index
Enhanced Human Computer Interaction using hand gesture analysis on GPU
Deep Learning for Computer Vision: Saliency Prediction (UPC 2016)
Centernet
Background Subtraction Based on Phase and Distance Transform Under Sudden Ill...
Pyclustering tutorial - K-means
Census and spatial data in sql server 2008 designing tools for hazard mitigat...
Clustering lect
AN ENHANCED SEPARABLE REVERSIBLE DATA HIDING IN ENCRYPTED IMAGES USING SIDE M...
2013.10.24 big datavisualization
Master defence 2020 - Vadym Korshunov - Region-Selected Image Generation with...
Machine Status Prediction for Dynamic and Heterogenous Cloud Environment
The International Journal of Engineering and Science (The IJES)
Yonsei Data Science Lab - Computer Vision
Ad

Similar to Cell calculation (20)

PDF
PPTX
Final Review
PDF
GRAY SCALE IMAGE SEGMENTATION USING OTSU THRESHOLDING OPTIMAL APPROACH
PDF
Lecture 9&10 computer vision segmentation-no_task
PPTX
Otsu binarization
PDF
Tracking of Fluorescent Cells Based on the Wavelet Otsu Model
PPTX
PDF
IMAGE SEGMENTATION BY USING THRESHOLDING TECHNIQUES FOR MEDICAL IMAGES
PPTX
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPT
PDF
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project R...
PDF
AUTOMATIC THRESHOLDING TECHNIQUES FOR OPTICAL IMAGES
PDF
OTSU Thresholding Method for Flower Image Segmentation
PPTX
Digital Image Processing Global Thresholding Using Otsu’sMethod
PPTX
Global Thresholding algorithm Using Otsu’s Method
PPTX
Digital Image Processing
PDF
Comparative between global threshold and adaptative threshold concepts in ima...
PDF
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGES
PDF
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGES
PPTX
Advanced 2D Otsu Method
PDF
ECE 565 Project1
Final Review
GRAY SCALE IMAGE SEGMENTATION USING OTSU THRESHOLDING OPTIMAL APPROACH
Lecture 9&10 computer vision segmentation-no_task
Otsu binarization
Tracking of Fluorescent Cells Based on the Wavelet Otsu Model
IMAGE SEGMENTATION BY USING THRESHOLDING TECHNIQUES FOR MEDICAL IMAGES
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPT
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project R...
AUTOMATIC THRESHOLDING TECHNIQUES FOR OPTICAL IMAGES
OTSU Thresholding Method for Flower Image Segmentation
Digital Image Processing Global Thresholding Using Otsu’sMethod
Global Thresholding algorithm Using Otsu’s Method
Digital Image Processing
Comparative between global threshold and adaptative threshold concepts in ima...
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGES
AUTOMATIC THRESHOLDING TECHNIQUES FOR SAR IMAGES
Advanced 2D Otsu Method
ECE 565 Project1
Ad

Recently uploaded (20)

PPTX
Software Engineering and software moduleing
PDF
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PDF
Soil Improvement Techniques Note - Rabbi
PDF
Design Guidelines and solutions for Plastics parts
PPTX
introduction to high performance computing
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PPTX
Fundamentals of Mechanical Engineering.pptx
PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PDF
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PPTX
Artificial Intelligence
PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
PPTX
communication and presentation skills 01
Software Engineering and software moduleing
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
Soil Improvement Techniques Note - Rabbi
Design Guidelines and solutions for Plastics parts
introduction to high performance computing
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
R24 SURVEYING LAB MANUAL for civil enggi
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Fundamentals of Mechanical Engineering.pptx
Nature of X-rays, X- Ray Equipment, Fluoroscopy
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
Artificial Intelligence
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
communication and presentation skills 01

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');
  • 9. Importing the images X: 349 Y: 270 Index: 173 RGB: 0.529, 0.529, 0.529 Original Image: Grayscale X: 456 Y: 546 Index: 171 RGB: 0.514, 0.514, 0.514 X: 746 Y: 388 Index: 176 RGB: 0.553, 0.553, 0.553
  • 10. Thresholding  In Matlab: ith=175/255; %Determine threshold by cursor img_t=im2bw(img_gs,th); %Convert to binary figure imshow(img_t); %Plot the image title('Thresholded Image');
  • 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');
  • 16. Image Subtraction 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);
  • 18. Image Subtraction 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)
  • 24. References  Gonzalez, R.C, Woods, R.E., Digital Image Procesing, 3rd Edition, Pearson Prentice Hall, 2008.  Images obtained from bioinstrumentation lab UC