SlideShare a Scribd company logo
Comparative between global thresholding and adaptative thresholding
concepts in image processing using Matlab
Assia HAMZA
assia.hamza@etu.usthb.dz
Merwan KHENAK
merwan.khenak@etu.usthb.dz
University of science and technology Houari Boumediene
BP 32, El Alia, Bab Ezzouar, 16111 Algiers, Algeria
Department of instrumentation and control
December 27, 2019
Abstract
A digital image can be considered as a discrete representation of data possessing both spatial (layout) and
intensity (colour) information. Pixel intensities form a gateway communication between human perception
of things and digital image processing.
Image thresholding is a simple form of image segmentation. It is a way to create a binary image from a
grayscale or full-color image. This is typically done in order to separate "object" or foreground pixels from
background pixels to aid in image processing.
In this paper we aim to present a small and modest comparative between two kind of image thresholding.
The local and adapatative concepts may not give the same correct results at the end of a process, and we
aim to demonstrate which kind of the two threshold concept is the best for counting objects in a RGB image
containing a lot of color intensities.
Keywords : Colorimetry - Image processing using Matlab - Threshold - Segmentation - Image analysis
1 Introduction
To understand an image, it has to be divided into differ-
ent meaningful parts called objects which can be easily
identiļ¬ed and depicts some information. This division
process is called image segmentation and threshold-
ing is one of the popular techniques for image seg-
mentation. It has low computational cost when com-
pared to other algorithms Image thresholding works on
the principle of pixel classiļ¬cation. It divides an im-
age into segments depending upon the pixel attributes.
This techniques applies on each pixel and by compar-
ing it to a speciļ¬c threshold value decides whether the
picture belongs to an object or background. For gray
images, the segmentation is carry out on the basis of
image gray levels where the brighter part of an image
is object and darker is background. The objects and
background of gray level images can be easily iden-
tiļ¬ed, but the process becomes more complicated for
color or textured images. So, for color and textured
images requires much more attention and processing
to get segmented. The thresholding is also affected by
the noise and artefacts present in image. Usually some
preprocessing steps are applied to reduce the noise and
artefacts effects.
The principal goal of the segmentation process is to
partition an image into regions that are homogeneous
with respect to one or more characteristics or fea-
tures. Segmentation is an important tool in many ļ¬eld
of applications such as medical image processing and
aerospace image processing.
In this example, we will use image thresholding con-
cepts to automatically calculate the number of objects
present for one image using different algorithms.
Thresholding is the simplest method of segmenting
image. From a grayscale image, it can be used to cre-
ate binary images.
In our project we are gonna use two basic methods of
thresholding the local thresholding and the adaptative
thresholding.
2 Materials and methods
In this project we only need Matlab software with im-
age processing toolbox pre-installed.
We aim to use thresholding methods to calculate au-
tomatically the number of objects present in a RGB
image. The following image in ļ¬gure 1 is the one we
are going to threshold.
1
Figure 1: The base image for the case of study
This image includes plenty of objects in different
shapes, and different colors.
The second step is to process the base image into a
gray scale image, the results is in ļ¬gure ??
And the histogram of the gray scale image is shown
below in ļ¬gure 3.
Figure 2: Processing result of the base image into gray
scale
Figure 3: The histogram of the gray scale image
Now that we have the histogram of the image in
gray scale, we can start our thresholding.
Just notice that the histogram of our image contains
only one peak, we are gonna explain this remark later.
2.1 Global thresholding :
Global threshold is totally dependent on the histogram
of the image. The histograms of images may be af-
fected with noise, contrast, hue, saturation, shadow
and more.
The aim of global threshold is to select a pixel intensity
value from the histogram and set all the greater inten-
sities from that value to the value 1, and the smaller
intensities to 0. We got then a binary image.
In our project we use the local center method on his-
togram to chose the value of threshold.
We devise the number center repeated of intensity
(11000) on the value of intensity repeated (210) we
got then a threshold value equal to 0.6.
We apply then a thresholding with 0.6 value on our
image and we got the segmented image in ļ¬gure 4.
Figure 4: The result of global threshold
We notice that the global threshold with local cen-
ter method made a loss of details in the image, the two
yellow balls disappeared.
2.2 Adaptative thresholding :
Like global thresholding, adaptive thresholding is used
to separate desirable foreground image objects from
the background based on the difference in pixel inten-
sities of each region. There is a lot of algorithms to
calculate the adaptative threshold value, the most well
know is the Otsu algorithm.
But in our project we use a general methode based on
thresholding the image for each RGB intensity.
First, we process the base image to a grey scaled image
2
for each basic color, so we have Red gray scale his-
togram shown in ļ¬gure 5 , Green gray scale histogram
shown in ļ¬gure 6 and Blue gray scale histogram shown
in ļ¬gure 7.
Figure 5: Processing result of Red gray scale his-
togram
Figure 6: Processing result of the Green gray scale his-
togram
Figure 7: Processing result of the Blue gray scale his-
togram
Now we do the same steps of global threshold for
each grey scale image for red, green and blue. The
result are shown below :
Figure 8: Global threshold of the Red gray scale
Figure 9: Global threshold of the Green gray scale
Figure 10: Global threshold of the Blue gray scale
Now to achieve the adaptative threshold to our
base image, all we need to do is to sum the Red gray
scale threshold, the Green gray scale threshold and the
3
Blue gray scale threshold image. The result of adapta-
tive threshold is shown in ļ¬gure 11.
Figure 11: The result of adaptative threshold
We notice that in contrary of the global threshold,
adaptative threshold have not lost objects in the image.
3 Results
Now after we did the global and adaptative threshold-
ing, we procede to the main objective of our applica-
tion that is to make a program capable of detecting
how many objects we have in the image.
To compute how many objects we have in the image
we display an algorithm that does these steps :
- Measure properties of image regions using ā€™region-
propsā€™ then ā€™stats.areaā€™ then ā€™stats.Eccentricityā€™ matlab
commands.
- Find Eccentricity of the Image.
- Make a Bounding box to every object of the image
and show the result of how many objects we have.
The result of the global threshold is shown if ļ¬gure 12
Figure 12: The result of global threshold computing
The result of computing gives as that there is 16
objects in the image which is false.
The two missing objects are the two balls lost in the
global threshold.
The result of the adaptative threshold is shown if ļ¬g-
ure 13
Figure 13: The result of adaptative threshold comput-
ing
The result of computing gives as that there is 18
objects in the image which is correct.
4 Conclusion
The computing error in global threshold is due to the
lost of information during thresholding.
The global thresholding is note intersting for use when
the histogram of the image we work on contains only
one peak. This cause the loss of important details
and informations we need in the image. The global
thresholding could be more for use on histogram that
contains two peaks.
The adaptative approach of threshold has shown sat-
isfying results, because we adapted the threshold for
every RGB scale in the image so we donā€™t lose details
and informations.
4
References
Gaurav Sharma 2003, Electrical engineering and applied signal processing series, Digital Color Imaging Hand-
book
Andreas Koschan, Mongi Abidi 2008, Digital color image processing
Christine Fernandez - Maloigne 2013, Advanced Color Image Processing and Analysis
Wilson, David, Laxminarayan, Swamy 2005, Handbook of Biomedical Image Analysis Volume 1: Segmenta-
tion Models
Uvais Qidwai and C. H. Chen 2009, DIGITAL IMAGE PROCESSING An Algorithmic Approach with MAT-
LAB
Chris Solomon and Toby Breckon 2011, Fundamentals of Digital Image Processing A Practical Approach with
Examples in Matlab
5

More Related Content

What's hot

COLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATION
COLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATIONCOLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATION
COLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATION
ecij
Ā 
Project report_DTRL_subrat
Project report_DTRL_subratProject report_DTRL_subrat
Project report_DTRL_subratSubrat Prasad
Ā 
Image inpainting
Image inpaintingImage inpainting
Image inpainting
Pulkit Goyal
Ā 
Image segmentation based on color
Image segmentation based on colorImage segmentation based on color
Image segmentation based on color
eSAT Publishing House
Ā 
D046022629
D046022629D046022629
D046022629
IJERA Editor
Ā 
improving differently illuminant images with fuzzy membership based saturatio...
improving differently illuminant images with fuzzy membership based saturatio...improving differently illuminant images with fuzzy membership based saturatio...
improving differently illuminant images with fuzzy membership based saturatio...
INFOGAIN PUBLICATION
Ā 
Mathematical operations in image processing
Mathematical operations in image processingMathematical operations in image processing
Mathematical operations in image processing
Asad Ali
Ā 
A Novel Color Image Fusion for Multi Sensor Night Vision Images
A Novel Color Image Fusion for Multi Sensor Night Vision ImagesA Novel Color Image Fusion for Multi Sensor Night Vision Images
A Novel Color Image Fusion for Multi Sensor Night Vision Images
Editor IJCATR
Ā 
Modified clahe an adaptive algorithm for contrast enhancement of aerial medi...
Modified clahe an adaptive algorithm for contrast enhancement of aerial  medi...Modified clahe an adaptive algorithm for contrast enhancement of aerial  medi...
Modified clahe an adaptive algorithm for contrast enhancement of aerial medi...
IAEME Publication
Ā 
337
337337
CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...
CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...
CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...
IJCSEA Journal
Ā 
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLINGAPPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
sipij
Ā 
Be03303560361
Be03303560361Be03303560361
Be03303560361ijceronline
Ā 
Multiexposure Image Fusion
Multiexposure Image FusionMultiexposure Image Fusion
Multiexposure Image Fusion
IJMER
Ā 
A Survey on Image Retrieval By Different Features and Techniques
A Survey on Image Retrieval By Different Features and TechniquesA Survey on Image Retrieval By Different Features and Techniques
A Survey on Image Retrieval By Different Features and Techniques
IRJET Journal
Ā 
Analysis of color image features extraction using texture methods
Analysis of color image features extraction using texture methodsAnalysis of color image features extraction using texture methods
Analysis of color image features extraction using texture methods
TELKOMNIKA JOURNAL
Ā 
Ijetr021211
Ijetr021211Ijetr021211
Image Inpainting
Image InpaintingImage Inpainting
Image Inpainting
IJERA Editor
Ā 

What's hot (19)

COLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATION
COLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATIONCOLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATION
COLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATION
Ā 
Project report_DTRL_subrat
Project report_DTRL_subratProject report_DTRL_subrat
Project report_DTRL_subrat
Ā 
Image inpainting
Image inpaintingImage inpainting
Image inpainting
Ā 
Image segmentation based on color
Image segmentation based on colorImage segmentation based on color
Image segmentation based on color
Ā 
D046022629
D046022629D046022629
D046022629
Ā 
G0813841
G0813841G0813841
G0813841
Ā 
improving differently illuminant images with fuzzy membership based saturatio...
improving differently illuminant images with fuzzy membership based saturatio...improving differently illuminant images with fuzzy membership based saturatio...
improving differently illuminant images with fuzzy membership based saturatio...
Ā 
Mathematical operations in image processing
Mathematical operations in image processingMathematical operations in image processing
Mathematical operations in image processing
Ā 
A Novel Color Image Fusion for Multi Sensor Night Vision Images
A Novel Color Image Fusion for Multi Sensor Night Vision ImagesA Novel Color Image Fusion for Multi Sensor Night Vision Images
A Novel Color Image Fusion for Multi Sensor Night Vision Images
Ā 
Modified clahe an adaptive algorithm for contrast enhancement of aerial medi...
Modified clahe an adaptive algorithm for contrast enhancement of aerial  medi...Modified clahe an adaptive algorithm for contrast enhancement of aerial  medi...
Modified clahe an adaptive algorithm for contrast enhancement of aerial medi...
Ā 
337
337337
337
Ā 
CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...
CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...
CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...
Ā 
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLINGAPPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
Ā 
Be03303560361
Be03303560361Be03303560361
Be03303560361
Ā 
Multiexposure Image Fusion
Multiexposure Image FusionMultiexposure Image Fusion
Multiexposure Image Fusion
Ā 
A Survey on Image Retrieval By Different Features and Techniques
A Survey on Image Retrieval By Different Features and TechniquesA Survey on Image Retrieval By Different Features and Techniques
A Survey on Image Retrieval By Different Features and Techniques
Ā 
Analysis of color image features extraction using texture methods
Analysis of color image features extraction using texture methodsAnalysis of color image features extraction using texture methods
Analysis of color image features extraction using texture methods
Ā 
Ijetr021211
Ijetr021211Ijetr021211
Ijetr021211
Ā 
Image Inpainting
Image InpaintingImage Inpainting
Image Inpainting
Ā 

Similar to Comparative between global threshold and adaptative threshold concepts in image processing

Image processing sw & hw
Image processing sw & hwImage processing sw & hw
Image processing sw & hw
amalalhait
Ā 
Ijarcet vol-2-issue-7-2319-2322
Ijarcet vol-2-issue-7-2319-2322Ijarcet vol-2-issue-7-2319-2322
Ijarcet vol-2-issue-7-2319-2322Editor IJARCET
Ā 
ANALYSIS OF IMAGE ENHANCEMENT TECHNIQUES USING MATLAB
ANALYSIS OF IMAGE ENHANCEMENT TECHNIQUES USING MATLABANALYSIS OF IMAGE ENHANCEMENT TECHNIQUES USING MATLAB
ANALYSIS OF IMAGE ENHANCEMENT TECHNIQUES USING MATLAB
Jim Jimenez
Ā 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
Ankur Nanda
Ā 
IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...
IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...
IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...
ijsrd.com
Ā 
h.pdf
h.pdfh.pdf
h.pdf
ssuser2c84bd1
Ā 
A review on image enhancement techniques
A review on image enhancement techniquesA review on image enhancement techniques
A review on image enhancement techniques
IJEACS
Ā 
A study and comparison of different image segmentation algorithms
A study and comparison of different image segmentation algorithmsA study and comparison of different image segmentation algorithms
A study and comparison of different image segmentation algorithms
Manje Gowda
Ā 
IRJET- Low Light Image Enhancement using Convolutional Neural Network
IRJET-  	  Low Light Image Enhancement using Convolutional Neural NetworkIRJET-  	  Low Light Image Enhancement using Convolutional Neural Network
IRJET- Low Light Image Enhancement using Convolutional Neural Network
IRJET Journal
Ā 
Enhanced Optimization of Edge Detection for High Resolution Images Using Veri...
Enhanced Optimization of Edge Detection for High Resolution Images Using Veri...Enhanced Optimization of Edge Detection for High Resolution Images Using Veri...
Enhanced Optimization of Edge Detection for High Resolution Images Using Veri...
ijcisjournal
Ā 
ee8220_project_W2013_v5
ee8220_project_W2013_v5ee8220_project_W2013_v5
ee8220_project_W2013_v5Farhad Gholami
Ā 
A Comparative Study on Image Contrast Enhancement Techniques
A Comparative Study on Image Contrast Enhancement TechniquesA Comparative Study on Image Contrast Enhancement Techniques
A Comparative Study on Image Contrast Enhancement Techniques
IRJET Journal
Ā 
IJ-M&M08.ppt
IJ-M&M08.pptIJ-M&M08.ppt
IJ-M&M08.ppt
SenukeTest
Ā 
Image colorization
Image colorizationImage colorization
Image colorization
Pankti Fadia
Ā 
IRJET- Coloring Greyscale Images using Deep Learning
IRJET- Coloring Greyscale Images using Deep LearningIRJET- Coloring Greyscale Images using Deep Learning
IRJET- Coloring Greyscale Images using Deep Learning
IRJET Journal
Ā 
A Comparative Study of Different Models on Image Colorization using Deep Lear...
A Comparative Study of Different Models on Image Colorization using Deep Lear...A Comparative Study of Different Models on Image Colorization using Deep Lear...
A Comparative Study of Different Models on Image Colorization using Deep Lear...
IRJET Journal
Ā 
Establishment of an Efficient Color Model from Existing Models for Better Gam...
Establishment of an Efficient Color Model from Existing Models for Better Gam...Establishment of an Efficient Color Model from Existing Models for Better Gam...
Establishment of an Efficient Color Model from Existing Models for Better Gam...
CSCJournals
Ā 
Fuzzy Logic based Contrast Enhancement
Fuzzy Logic based Contrast EnhancementFuzzy Logic based Contrast Enhancement
Fuzzy Logic based Contrast Enhancement
Samrudh Keshava Kumar
Ā 

Similar to Comparative between global threshold and adaptative threshold concepts in image processing (20)

Image processing sw & hw
Image processing sw & hwImage processing sw & hw
Image processing sw & hw
Ā 
Ijarcet vol-2-issue-7-2319-2322
Ijarcet vol-2-issue-7-2319-2322Ijarcet vol-2-issue-7-2319-2322
Ijarcet vol-2-issue-7-2319-2322
Ā 
ANALYSIS OF IMAGE ENHANCEMENT TECHNIQUES USING MATLAB
ANALYSIS OF IMAGE ENHANCEMENT TECHNIQUES USING MATLABANALYSIS OF IMAGE ENHANCEMENT TECHNIQUES USING MATLAB
ANALYSIS OF IMAGE ENHANCEMENT TECHNIQUES USING MATLAB
Ā 
Project 2
Project 2Project 2
Project 2
Ā 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
Ā 
IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...
IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...
IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...
Ā 
h.pdf
h.pdfh.pdf
h.pdf
Ā 
A review on image enhancement techniques
A review on image enhancement techniquesA review on image enhancement techniques
A review on image enhancement techniques
Ā 
A study and comparison of different image segmentation algorithms
A study and comparison of different image segmentation algorithmsA study and comparison of different image segmentation algorithms
A study and comparison of different image segmentation algorithms
Ā 
IRJET- Low Light Image Enhancement using Convolutional Neural Network
IRJET-  	  Low Light Image Enhancement using Convolutional Neural NetworkIRJET-  	  Low Light Image Enhancement using Convolutional Neural Network
IRJET- Low Light Image Enhancement using Convolutional Neural Network
Ā 
Enhanced Optimization of Edge Detection for High Resolution Images Using Veri...
Enhanced Optimization of Edge Detection for High Resolution Images Using Veri...Enhanced Optimization of Edge Detection for High Resolution Images Using Veri...
Enhanced Optimization of Edge Detection for High Resolution Images Using Veri...
Ā 
ee8220_project_W2013_v5
ee8220_project_W2013_v5ee8220_project_W2013_v5
ee8220_project_W2013_v5
Ā 
A Comparative Study on Image Contrast Enhancement Techniques
A Comparative Study on Image Contrast Enhancement TechniquesA Comparative Study on Image Contrast Enhancement Techniques
A Comparative Study on Image Contrast Enhancement Techniques
Ā 
IJ-M&M08.ppt
IJ-M&M08.pptIJ-M&M08.ppt
IJ-M&M08.ppt
Ā 
Image colorization
Image colorizationImage colorization
Image colorization
Ā 
IRJET- Coloring Greyscale Images using Deep Learning
IRJET- Coloring Greyscale Images using Deep LearningIRJET- Coloring Greyscale Images using Deep Learning
IRJET- Coloring Greyscale Images using Deep Learning
Ā 
Ijetcas14 372
Ijetcas14 372Ijetcas14 372
Ijetcas14 372
Ā 
A Comparative Study of Different Models on Image Colorization using Deep Lear...
A Comparative Study of Different Models on Image Colorization using Deep Lear...A Comparative Study of Different Models on Image Colorization using Deep Lear...
A Comparative Study of Different Models on Image Colorization using Deep Lear...
Ā 
Establishment of an Efficient Color Model from Existing Models for Better Gam...
Establishment of an Efficient Color Model from Existing Models for Better Gam...Establishment of an Efficient Color Model from Existing Models for Better Gam...
Establishment of an Efficient Color Model from Existing Models for Better Gam...
Ā 
Fuzzy Logic based Contrast Enhancement
Fuzzy Logic based Contrast EnhancementFuzzy Logic based Contrast Enhancement
Fuzzy Logic based Contrast Enhancement
Ā 

Recently uploaded

MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
Ā 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
Ā 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
Ā 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
Ā 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
Ā 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
Ā 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
Ā 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
Ā 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
Ā 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
Ā 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
Ā 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
Ā 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
Ā 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
Ā 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
Ā 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
Ā 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
Ā 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
Ā 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
Ā 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
Ā 

Recently uploaded (20)

MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Ā 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Ā 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
Ā 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Ā 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
Ā 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
Ā 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
Ā 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Ā 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
Ā 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Ā 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Ā 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Ā 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
Ā 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Ā 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Ā 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
Ā 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Ā 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
Ā 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
Ā 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Ā 

Comparative between global threshold and adaptative threshold concepts in image processing

  • 1. Comparative between global thresholding and adaptative thresholding concepts in image processing using Matlab Assia HAMZA assia.hamza@etu.usthb.dz Merwan KHENAK merwan.khenak@etu.usthb.dz University of science and technology Houari Boumediene BP 32, El Alia, Bab Ezzouar, 16111 Algiers, Algeria Department of instrumentation and control December 27, 2019 Abstract A digital image can be considered as a discrete representation of data possessing both spatial (layout) and intensity (colour) information. Pixel intensities form a gateway communication between human perception of things and digital image processing. Image thresholding is a simple form of image segmentation. It is a way to create a binary image from a grayscale or full-color image. This is typically done in order to separate "object" or foreground pixels from background pixels to aid in image processing. In this paper we aim to present a small and modest comparative between two kind of image thresholding. The local and adapatative concepts may not give the same correct results at the end of a process, and we aim to demonstrate which kind of the two threshold concept is the best for counting objects in a RGB image containing a lot of color intensities. Keywords : Colorimetry - Image processing using Matlab - Threshold - Segmentation - Image analysis 1 Introduction To understand an image, it has to be divided into differ- ent meaningful parts called objects which can be easily identiļ¬ed and depicts some information. This division process is called image segmentation and threshold- ing is one of the popular techniques for image seg- mentation. It has low computational cost when com- pared to other algorithms Image thresholding works on the principle of pixel classiļ¬cation. It divides an im- age into segments depending upon the pixel attributes. This techniques applies on each pixel and by compar- ing it to a speciļ¬c threshold value decides whether the picture belongs to an object or background. For gray images, the segmentation is carry out on the basis of image gray levels where the brighter part of an image is object and darker is background. The objects and background of gray level images can be easily iden- tiļ¬ed, but the process becomes more complicated for color or textured images. So, for color and textured images requires much more attention and processing to get segmented. The thresholding is also affected by the noise and artefacts present in image. Usually some preprocessing steps are applied to reduce the noise and artefacts effects. The principal goal of the segmentation process is to partition an image into regions that are homogeneous with respect to one or more characteristics or fea- tures. Segmentation is an important tool in many ļ¬eld of applications such as medical image processing and aerospace image processing. In this example, we will use image thresholding con- cepts to automatically calculate the number of objects present for one image using different algorithms. Thresholding is the simplest method of segmenting image. From a grayscale image, it can be used to cre- ate binary images. In our project we are gonna use two basic methods of thresholding the local thresholding and the adaptative thresholding. 2 Materials and methods In this project we only need Matlab software with im- age processing toolbox pre-installed. We aim to use thresholding methods to calculate au- tomatically the number of objects present in a RGB image. The following image in ļ¬gure 1 is the one we are going to threshold. 1
  • 2. Figure 1: The base image for the case of study This image includes plenty of objects in different shapes, and different colors. The second step is to process the base image into a gray scale image, the results is in ļ¬gure ?? And the histogram of the gray scale image is shown below in ļ¬gure 3. Figure 2: Processing result of the base image into gray scale Figure 3: The histogram of the gray scale image Now that we have the histogram of the image in gray scale, we can start our thresholding. Just notice that the histogram of our image contains only one peak, we are gonna explain this remark later. 2.1 Global thresholding : Global threshold is totally dependent on the histogram of the image. The histograms of images may be af- fected with noise, contrast, hue, saturation, shadow and more. The aim of global threshold is to select a pixel intensity value from the histogram and set all the greater inten- sities from that value to the value 1, and the smaller intensities to 0. We got then a binary image. In our project we use the local center method on his- togram to chose the value of threshold. We devise the number center repeated of intensity (11000) on the value of intensity repeated (210) we got then a threshold value equal to 0.6. We apply then a thresholding with 0.6 value on our image and we got the segmented image in ļ¬gure 4. Figure 4: The result of global threshold We notice that the global threshold with local cen- ter method made a loss of details in the image, the two yellow balls disappeared. 2.2 Adaptative thresholding : Like global thresholding, adaptive thresholding is used to separate desirable foreground image objects from the background based on the difference in pixel inten- sities of each region. There is a lot of algorithms to calculate the adaptative threshold value, the most well know is the Otsu algorithm. But in our project we use a general methode based on thresholding the image for each RGB intensity. First, we process the base image to a grey scaled image 2
  • 3. for each basic color, so we have Red gray scale his- togram shown in ļ¬gure 5 , Green gray scale histogram shown in ļ¬gure 6 and Blue gray scale histogram shown in ļ¬gure 7. Figure 5: Processing result of Red gray scale his- togram Figure 6: Processing result of the Green gray scale his- togram Figure 7: Processing result of the Blue gray scale his- togram Now we do the same steps of global threshold for each grey scale image for red, green and blue. The result are shown below : Figure 8: Global threshold of the Red gray scale Figure 9: Global threshold of the Green gray scale Figure 10: Global threshold of the Blue gray scale Now to achieve the adaptative threshold to our base image, all we need to do is to sum the Red gray scale threshold, the Green gray scale threshold and the 3
  • 4. Blue gray scale threshold image. The result of adapta- tive threshold is shown in ļ¬gure 11. Figure 11: The result of adaptative threshold We notice that in contrary of the global threshold, adaptative threshold have not lost objects in the image. 3 Results Now after we did the global and adaptative threshold- ing, we procede to the main objective of our applica- tion that is to make a program capable of detecting how many objects we have in the image. To compute how many objects we have in the image we display an algorithm that does these steps : - Measure properties of image regions using ā€™region- propsā€™ then ā€™stats.areaā€™ then ā€™stats.Eccentricityā€™ matlab commands. - Find Eccentricity of the Image. - Make a Bounding box to every object of the image and show the result of how many objects we have. The result of the global threshold is shown if ļ¬gure 12 Figure 12: The result of global threshold computing The result of computing gives as that there is 16 objects in the image which is false. The two missing objects are the two balls lost in the global threshold. The result of the adaptative threshold is shown if ļ¬g- ure 13 Figure 13: The result of adaptative threshold comput- ing The result of computing gives as that there is 18 objects in the image which is correct. 4 Conclusion The computing error in global threshold is due to the lost of information during thresholding. The global thresholding is note intersting for use when the histogram of the image we work on contains only one peak. This cause the loss of important details and informations we need in the image. The global thresholding could be more for use on histogram that contains two peaks. The adaptative approach of threshold has shown sat- isfying results, because we adapted the threshold for every RGB scale in the image so we donā€™t lose details and informations. 4
  • 5. References Gaurav Sharma 2003, Electrical engineering and applied signal processing series, Digital Color Imaging Hand- book Andreas Koschan, Mongi Abidi 2008, Digital color image processing Christine Fernandez - Maloigne 2013, Advanced Color Image Processing and Analysis Wilson, David, Laxminarayan, Swamy 2005, Handbook of Biomedical Image Analysis Volume 1: Segmenta- tion Models Uvais Qidwai and C. H. Chen 2009, DIGITAL IMAGE PROCESSING An Algorithmic Approach with MAT- LAB Chris Solomon and Toby Breckon 2011, Fundamentals of Digital Image Processing A Practical Approach with Examples in Matlab 5