SlideShare a Scribd company logo
1 of 11
Download to read offline
Threshold selection for image segmentation by region approach
Parijat Sinha (Non member)
Abstract
This paper is examines the different image segmentation techniques. Two images have been
considered for this experiment. The first image shows rice grains scattered randomly on a
contrasting image. The second image is a spot image developed using commercially available
software. Results have been obtained using a program written in Visual BASIC 6.0 by the author.
The output images have been compiled into tables.
Introduction
The computer vision branch of the field of artificial intelligence is concerned with developing
algorithms for analyzing the content of an image. The two main approaches that have come up
are statistical pattern recognition and neural networks. The statistical pattern recognition method
is the most widely use approach.
Statistical pattern recognition assumes that the image may contain one or more objects and that
each object belongs to one of several predetermine types, categories, or pattern classes. Given a
digitized image containing several objects, the pattern recognition process consists of three main
phases.
The first phase is called image segmentation or object isolation, in which each object is found
and its image is isolated from the rest of the scene.
The second phase is called feature extraction. This is where the objects are measured. A
measurement is the value of some quantifiable property of an object. A feature is a function of
one or more measurements, computed so that it quantifies some significant characteristic of the
object.
The third phase of pattern recognition is classification. Its output is merely a decision regarding
the class to which each object belongs. Each object is recognized as being of one particular type
and the recognition is implemented as a classification process. Each object is assigned to one of
several pre-established groups (classes) that represent all the possible types of objects expected to
exist in the image.
Object
   Input                         Object                                                      type
   image                         image
              Image                          Feature                    Classification
              segmentation                   extraction


                         The three phases of pattern recognition


The image segmentation process
Image segmentation can be defined as a process that partitions a digital image into disjoint (non-
overlapping) regions. A region is a connected set of pixels—that is, a set in which all pixels are
adjacent or touching. The formal definition of connectedness is as follows: between any two
pixels in a connected set, there exists a connected path wholly within the set, where a connected
path is a path that always moves between neighboring pixels. Thus in a connected set, a
connected path can be traced between any two pixels without ever leaving the set.
When a human observer views a scene, the processing that takes place in the visual system
essentially segments the scene for him or her. This is done so effectively that one sees not a
complex scene, but rather something one thinks of as a collection of objects. With digital
processing, however, the objects in an image are laboriously isolated by breaking up the image
into sets of pixels, each of which is the image of one object.
Image segmentation can be approached from three different philosophical perspectives. In the
case called region approach, one assigns each pixel to a particular object or region. In the
boundary approach, one attempts only to locate the boundaries that exist between the regions.
In the edge approach, one seeks to identify edge pixels and then link them together to form the
required boundaries. All three approaches are useful for visualizing the problem.


Histogram
A histogram uses a bar graph to profile the occurrences of each gray level present in an image.
An image with poor contrast has a histogram having the gray levels grouped in the dark half of
the scale. The cure for low contrast images is “histogram equalization”. Equalization causes a
histogram with a mountain grouped closely together to spread out into a flat or equalized
histogram.
The mathematical transform for the histogram equalization algorithm is derived as shown:-
Consider an image c with a poor histogram. The as yet unknown function f transforms the image
c into an image b with a flat histogram.
b(x, y) = f[c(x, y)]
Let p1 (a) is the probability of finding a pixel with the value a in the image. Area1 is the number
of pixels in the image and H1(a) is the histogram of the image. The probability density function
                                       of a pixel value a is
                                     p1(a) = (1/area1)* H1(a)
The cumulative density function (cdf) is the sum of all the probability density functions up to
the value a.
                                   p1(a) = (1/area1)* ∑ H1(i)
Hc(a) is the histogram of the original image c. Dm is the number of gray levels in the new image
b. the desired histogram equalization function f(a) is given as
                                  f(a) = Dm*(1/area1)* ∑ Hc(a)


Adverse effect
Histogram equalization followed by smoothing is often considered as the initial step in image
segmentation process. But with some images the equalized image may appear worse than the
original image. In a properly scanned image, histogram equalization can introduce noise into
what were uniform areas of an image.
The following photographs show the effect of histogram equalization on the photograph and the
histogram. The histograms are of the lower left part of the image in an area of 20*20. As visible,
equalization has induced noise into the image. Thus a prudent choice should be made before
opting for histogram equalization of images.




Original image                                     Equalized image
Histogram for original image                         Histogram for equalized image


Image segmentation by thresholding
Thresholding is a particularly useful region approach technique for scenes containing solid
objects resting upon a contrasting background. It is computationally simple and never fails to
define disjoint regions with closed, connected boundaries.
When using a threshold rule for image segmentation, one assigns all pixels at or above the
threshold gray level to the object. All pixels with gray level below the threshold fall outside the
object. The boundary is then that set of interior points each of which has at least one neighbor
outside the object.
Thresholding works well if the objects of interest have uniform gray level and rest upon a
background of different but uniform gray level.
Global thresholding
In the simplest implementation of boundary location by thresholding, the value of the threshold
gray level is held constant throughout the image. If the background gray level is reasonably
constant throughout, and if the objects all have approximately equal contrast above the
background, then a fixed global threshold will usually work well, provided that the threshold gray
level is properly selected.
A global threshold of 128 on gray scale has been considered to obtain the binary image of rice
grains.
Optimal threshold selection
Unless the object in the image has extremely steep sides, the exact value of the threshold gray
level can have considerable effect on the boundary position an overall size of the extracted object.
This means that subsequent size measurements are sensitive to the threshold gray level. Thus an
optimal or at least consistent method is needed to establish the threshold.
The two most common techniques in vogue are mentioned.
Histogram peak technique
This technique finds the two peaks in the histogram corresponding to the background and object
of the image. It sets the threshold halfway between the two peaks. When the histograms are
searched for peaks, peak spacing should be used to ensure the highest peaks are separated.
Another item to watch carefully determining which peak corresponds to the background and
which corresponds to the object.
Histogram valley technique
This technique uses the peaks of the histogram, but concentrates on the valleys between them.
Instead of setting the midpoint arbitrarily halfway between the two peaks, the valley technique
searches between the two peaks to find the lowest valley.




 Histogram for equalized image                        Histogram for original image

Adaptive thresholding
In many cases, the background gray level is not constant, and the contrast of objects varies within
the image. In such cases, a threshold that works well in one area of the image might work poorly
in other areas. In such cases it is convenient to use a threshold gray level that is a slowly varying
function of position in image.
The author implemented the adaptive technique by dividing the whole image into 10*10 (and 5*5
also for some cases) size squares and then calculating a threshold for each square individually
using the histogram peak technique for optimal threshold calculation.
Results




Original image                                   Enhanced image




Global thresholding has been applied to the      Global thresholding has been applied to the
normal image. Some rice grains are left out in   enhanced image. A greater number of rice
this process.                                    grains are visible if one looks at the lower part.
                                                 But at the same time some noise has been
                                                 induced.
Adaptive thresholding has been applied to the     Adaptive thresholding has been applied to the
enhanced image considering 5*5 squares. All       normal image considering 5*5 squares. All the
the grains are visible but the noise content is   grains are visible but noise level is still too
too high, making the image useless.               high.




Adaptive thresholding has been applied to a       Adaptive thresholding has been applied to the
smoothed image considering 5*5 squares. The       normal image considering 10*10 squares.
noise is still quite high.                        Some grains look distorted but it is the best
                                                  image obtained with a little noise.




Another method commonly used sets the threshold point at a given percentage of pixels in the
histogram. The histogram for the edge detector output is calculated and the values are summed
starting from zero. When this sum exceeds a given percent of the total the threshold value is
obtained. A good percentage to use is 50% for most edge detectors and images. This method was
applied on 10*10 squares under the adaptive thresholding method. The image was thresholded at
different percentages and the results are as shown.
Image using 40% thresholding                             Image using 70% thresholding
The noise content is too high in the first image and an attempt to reduce it by increasing the
threshold results in a loss in details.


The analysis of spots
Suppose an image B(x, y) contains a single spot. By definition, this image contains a point (x0, y0)
of maximum gray level. If polar co-ordinates centered upon (x0, y0) are established so that image
is given by Bp (r1, theta) >= Bp (r2, theta) if r2>r1.
B (x, y) is called a monotone spot of equality is not allowed in the above equation. This means
that the gray level strictly decreases along a line extending out in any direction from the center
point.
An important special case occurs if all contours of a monotone spot are circles centered on the
center point. This special case is called a concentric circular spot (CCS). To a good
approximation, this usually describes the noise-free image of stars in a telescope, certain cells in a
microscope and many other important things.
The author has used an image of a CCS developed using Adobe Photoshop 6.0. The results are
shown below.
The spot developed using Adobe Photoshop 6.0 Spot profile function: scan line along the center
                                                showing the variation in intensity.




Edge detection using Robert’s edge detector.    Edge detection using contrast based edge
Spot can be made out.                           detector. Very feeble broken lines are visible.




Adaptive thresholding applied on image,         Adaptive thresholding applied on image,
thresholding being done at 75%.                 thresholding being done at 60%.
Adaptive thresholding applied on image,             Adaptive thresholding applied on image,
thresholding being done at 50%.                     thresholding being done using histogram peak
                                                    method.




Global thresholding using 128 gray level.           Output obtained using other detectors.




Conclusion
As evident, a spot can be best analyzed using the adaptive thresholding or by studying the spot
profile function. Most other edge detectors fail to give a satisfactory result.


References
    1. Kenneth R. Castleman, Digital Image Processing, Prentice-Hall 1996
    2. Dwayne Philips, Image Processing in C, 1995
Threshold Selection for Image segmentation

More Related Content

What's hot

Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processingAhmed Daoud
 
Chapter 6 color image processing
Chapter 6 color image processingChapter 6 color image processing
Chapter 6 color image processingasodariyabhavesh
 
Image enhancement in the spatial domain1
Image enhancement in the spatial domain1Image enhancement in the spatial domain1
Image enhancement in the spatial domain1shabanam tamboli
 
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)asodariyabhavesh
 
Intensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringIntensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringShajun Nisha
 
Chapter 9 morphological image processing
Chapter 9 morphological image processingChapter 9 morphological image processing
Chapter 9 morphological image processingasodariyabhavesh
 
Image feature extraction
Image feature extractionImage feature extraction
Image feature extractionRishabh shah
 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filtersA B Shinde
 
Lect 03 - first portion
Lect 03 - first portionLect 03 - first portion
Lect 03 - first portionMoe Moe Myint
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainA B Shinde
 
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...Hemantha Kulathilake
 
4.intensity transformations
4.intensity transformations4.intensity transformations
4.intensity transformationsYahya Alkhaldi
 
Comparative study on image segmentation techniques
Comparative study on image segmentation techniquesComparative study on image segmentation techniques
Comparative study on image segmentation techniquesgmidhubala
 
Image processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filtersImage processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filtersKuppusamy P
 
Digital Image restoration
Digital Image restorationDigital Image restoration
Digital Image restorationMd Shabir Alam
 

What's hot (20)

Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processing
 
Chapter 6 color image processing
Chapter 6 color image processingChapter 6 color image processing
Chapter 6 color image processing
 
Image enhancement in the spatial domain1
Image enhancement in the spatial domain1Image enhancement in the spatial domain1
Image enhancement in the spatial domain1
 
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)
 
Intensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringIntensity Transformation and Spatial filtering
Intensity Transformation and Spatial filtering
 
Chapter 9 morphological image processing
Chapter 9 morphological image processingChapter 9 morphological image processing
Chapter 9 morphological image processing
 
Edge detection
Edge detectionEdge detection
Edge detection
 
Image feature extraction
Image feature extractionImage feature extraction
Image feature extraction
 
Psuedo color
Psuedo colorPsuedo color
Psuedo color
 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filters
 
Lect 03 - first portion
Lect 03 - first portionLect 03 - first portion
Lect 03 - first portion
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
 
4.intensity transformations
4.intensity transformations4.intensity transformations
4.intensity transformations
 
Comparative study on image segmentation techniques
Comparative study on image segmentation techniquesComparative study on image segmentation techniques
Comparative study on image segmentation techniques
 
Antialiasing
AntialiasingAntialiasing
Antialiasing
 
IMAGE SEGMENTATION.
IMAGE SEGMENTATION.IMAGE SEGMENTATION.
IMAGE SEGMENTATION.
 
Image processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filtersImage processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filters
 
Digital Image restoration
Digital Image restorationDigital Image restoration
Digital Image restoration
 

Similar to Threshold Selection for Image segmentation

Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...
Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...
Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...IJMER
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)theijes
 
Visible surface identification
Visible surface identificationVisible surface identification
Visible surface identificationPooja Dixit
 
Practical Digital Image Processing 2
Practical Digital Image Processing 2Practical Digital Image Processing 2
Practical Digital Image Processing 2Aly Abdelkareem
 
BilateralFiltering
BilateralFilteringBilateralFiltering
BilateralFilteringJacob Logas
 
Texture By Priyanka Chauhan
Texture By Priyanka ChauhanTexture By Priyanka Chauhan
Texture By Priyanka ChauhanPriyanka Chauhan
 
Performance Evaluation of Filters for Enhancement of Images in Different Appl...
Performance Evaluation of Filters for Enhancement of Images in Different Appl...Performance Evaluation of Filters for Enhancement of Images in Different Appl...
Performance Evaluation of Filters for Enhancement of Images in Different Appl...IOSR Journals
 
Image segmentation
Image segmentationImage segmentation
Image segmentationKuppusamy P
 
Image pre processing
Image pre processingImage pre processing
Image pre processingAshish Kumar
 
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 MATLABJim Jimenez
 
Object based image enhancement
Object based image enhancementObject based image enhancement
Object based image enhancementijait
 
A Fuzzy Set Approach for Edge Detection
A Fuzzy Set Approach for Edge DetectionA Fuzzy Set Approach for Edge Detection
A Fuzzy Set Approach for Edge DetectionCSCJournals
 
A Novel Edge Detection Technique for Image Classification and Analysis
A Novel Edge Detection Technique for Image Classification and AnalysisA Novel Edge Detection Technique for Image Classification and Analysis
A Novel Edge Detection Technique for Image Classification and AnalysisIOSR Journals
 
motion and feature based person tracking in survillance videos
motion and feature based person tracking in survillance videosmotion and feature based person tracking in survillance videos
motion and feature based person tracking in survillance videosshiva kumar cheruku
 

Similar to Threshold Selection for Image segmentation (20)

Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...
Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...
Comparison of Histogram Equalization Techniques for Image Enhancement of Gray...
 
Extended fuzzy c means clustering algorithm in segmentation of noisy images
Extended fuzzy c means clustering algorithm in segmentation of noisy imagesExtended fuzzy c means clustering algorithm in segmentation of noisy images
Extended fuzzy c means clustering algorithm in segmentation of noisy images
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
 
Visible surface identification
Visible surface identificationVisible surface identification
Visible surface identification
 
Practical Digital Image Processing 2
Practical Digital Image Processing 2Practical Digital Image Processing 2
Practical Digital Image Processing 2
 
BilateralFiltering
BilateralFilteringBilateralFiltering
BilateralFiltering
 
Texture By Priyanka Chauhan
Texture By Priyanka ChauhanTexture By Priyanka Chauhan
Texture By Priyanka Chauhan
 
Performance Evaluation of Filters for Enhancement of Images in Different Appl...
Performance Evaluation of Filters for Enhancement of Images in Different Appl...Performance Evaluation of Filters for Enhancement of Images in Different Appl...
Performance Evaluation of Filters for Enhancement of Images in Different Appl...
 
Hidden Surface Removal.pptx
Hidden Surface Removal.pptxHidden Surface Removal.pptx
Hidden Surface Removal.pptx
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Image pre processing
Image pre processingImage pre processing
Image pre processing
 
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
 
Final Review
Final ReviewFinal Review
Final Review
 
Object based image enhancement
Object based image enhancementObject based image enhancement
Object based image enhancement
 
A Fuzzy Set Approach for Edge Detection
A Fuzzy Set Approach for Edge DetectionA Fuzzy Set Approach for Edge Detection
A Fuzzy Set Approach for Edge Detection
 
regions
regionsregions
regions
 
A Novel Edge Detection Technique for Image Classification and Analysis
A Novel Edge Detection Technique for Image Classification and AnalysisA Novel Edge Detection Technique for Image Classification and Analysis
A Novel Edge Detection Technique for Image Classification and Analysis
 
Report
ReportReport
Report
 
motion and feature based person tracking in survillance videos
motion and feature based person tracking in survillance videosmotion and feature based person tracking in survillance videos
motion and feature based person tracking in survillance videos
 
I017417176
I017417176I017417176
I017417176
 

Recently uploaded

Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
The Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementThe Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementNuwan Dias
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
IEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK GuideIEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK GuideHironori Washizaki
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 

Recently uploaded (20)

Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
The Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementThe Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API Management
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
IEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK GuideIEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 

Threshold Selection for Image segmentation

  • 1. Threshold selection for image segmentation by region approach Parijat Sinha (Non member) Abstract This paper is examines the different image segmentation techniques. Two images have been considered for this experiment. The first image shows rice grains scattered randomly on a contrasting image. The second image is a spot image developed using commercially available software. Results have been obtained using a program written in Visual BASIC 6.0 by the author. The output images have been compiled into tables. Introduction The computer vision branch of the field of artificial intelligence is concerned with developing algorithms for analyzing the content of an image. The two main approaches that have come up are statistical pattern recognition and neural networks. The statistical pattern recognition method is the most widely use approach. Statistical pattern recognition assumes that the image may contain one or more objects and that each object belongs to one of several predetermine types, categories, or pattern classes. Given a digitized image containing several objects, the pattern recognition process consists of three main phases. The first phase is called image segmentation or object isolation, in which each object is found and its image is isolated from the rest of the scene. The second phase is called feature extraction. This is where the objects are measured. A measurement is the value of some quantifiable property of an object. A feature is a function of one or more measurements, computed so that it quantifies some significant characteristic of the object. The third phase of pattern recognition is classification. Its output is merely a decision regarding the class to which each object belongs. Each object is recognized as being of one particular type and the recognition is implemented as a classification process. Each object is assigned to one of several pre-established groups (classes) that represent all the possible types of objects expected to exist in the image.
  • 2. Object Input Object type image image Image Feature Classification segmentation extraction The three phases of pattern recognition The image segmentation process Image segmentation can be defined as a process that partitions a digital image into disjoint (non- overlapping) regions. A region is a connected set of pixels—that is, a set in which all pixels are adjacent or touching. The formal definition of connectedness is as follows: between any two pixels in a connected set, there exists a connected path wholly within the set, where a connected path is a path that always moves between neighboring pixels. Thus in a connected set, a connected path can be traced between any two pixels without ever leaving the set. When a human observer views a scene, the processing that takes place in the visual system essentially segments the scene for him or her. This is done so effectively that one sees not a complex scene, but rather something one thinks of as a collection of objects. With digital processing, however, the objects in an image are laboriously isolated by breaking up the image into sets of pixels, each of which is the image of one object. Image segmentation can be approached from three different philosophical perspectives. In the case called region approach, one assigns each pixel to a particular object or region. In the boundary approach, one attempts only to locate the boundaries that exist between the regions. In the edge approach, one seeks to identify edge pixels and then link them together to form the required boundaries. All three approaches are useful for visualizing the problem. Histogram A histogram uses a bar graph to profile the occurrences of each gray level present in an image. An image with poor contrast has a histogram having the gray levels grouped in the dark half of the scale. The cure for low contrast images is “histogram equalization”. Equalization causes a histogram with a mountain grouped closely together to spread out into a flat or equalized histogram. The mathematical transform for the histogram equalization algorithm is derived as shown:- Consider an image c with a poor histogram. The as yet unknown function f transforms the image c into an image b with a flat histogram.
  • 3. b(x, y) = f[c(x, y)] Let p1 (a) is the probability of finding a pixel with the value a in the image. Area1 is the number of pixels in the image and H1(a) is the histogram of the image. The probability density function of a pixel value a is p1(a) = (1/area1)* H1(a) The cumulative density function (cdf) is the sum of all the probability density functions up to the value a. p1(a) = (1/area1)* ∑ H1(i) Hc(a) is the histogram of the original image c. Dm is the number of gray levels in the new image b. the desired histogram equalization function f(a) is given as f(a) = Dm*(1/area1)* ∑ Hc(a) Adverse effect Histogram equalization followed by smoothing is often considered as the initial step in image segmentation process. But with some images the equalized image may appear worse than the original image. In a properly scanned image, histogram equalization can introduce noise into what were uniform areas of an image. The following photographs show the effect of histogram equalization on the photograph and the histogram. The histograms are of the lower left part of the image in an area of 20*20. As visible, equalization has induced noise into the image. Thus a prudent choice should be made before opting for histogram equalization of images. Original image Equalized image
  • 4. Histogram for original image Histogram for equalized image Image segmentation by thresholding Thresholding is a particularly useful region approach technique for scenes containing solid objects resting upon a contrasting background. It is computationally simple and never fails to define disjoint regions with closed, connected boundaries. When using a threshold rule for image segmentation, one assigns all pixels at or above the threshold gray level to the object. All pixels with gray level below the threshold fall outside the object. The boundary is then that set of interior points each of which has at least one neighbor outside the object. Thresholding works well if the objects of interest have uniform gray level and rest upon a background of different but uniform gray level. Global thresholding In the simplest implementation of boundary location by thresholding, the value of the threshold gray level is held constant throughout the image. If the background gray level is reasonably constant throughout, and if the objects all have approximately equal contrast above the background, then a fixed global threshold will usually work well, provided that the threshold gray level is properly selected. A global threshold of 128 on gray scale has been considered to obtain the binary image of rice grains. Optimal threshold selection Unless the object in the image has extremely steep sides, the exact value of the threshold gray level can have considerable effect on the boundary position an overall size of the extracted object.
  • 5. This means that subsequent size measurements are sensitive to the threshold gray level. Thus an optimal or at least consistent method is needed to establish the threshold. The two most common techniques in vogue are mentioned. Histogram peak technique This technique finds the two peaks in the histogram corresponding to the background and object of the image. It sets the threshold halfway between the two peaks. When the histograms are searched for peaks, peak spacing should be used to ensure the highest peaks are separated. Another item to watch carefully determining which peak corresponds to the background and which corresponds to the object. Histogram valley technique This technique uses the peaks of the histogram, but concentrates on the valleys between them. Instead of setting the midpoint arbitrarily halfway between the two peaks, the valley technique searches between the two peaks to find the lowest valley. Histogram for equalized image Histogram for original image Adaptive thresholding In many cases, the background gray level is not constant, and the contrast of objects varies within the image. In such cases, a threshold that works well in one area of the image might work poorly in other areas. In such cases it is convenient to use a threshold gray level that is a slowly varying function of position in image. The author implemented the adaptive technique by dividing the whole image into 10*10 (and 5*5 also for some cases) size squares and then calculating a threshold for each square individually using the histogram peak technique for optimal threshold calculation.
  • 6. Results Original image Enhanced image Global thresholding has been applied to the Global thresholding has been applied to the normal image. Some rice grains are left out in enhanced image. A greater number of rice this process. grains are visible if one looks at the lower part. But at the same time some noise has been induced.
  • 7. Adaptive thresholding has been applied to the Adaptive thresholding has been applied to the enhanced image considering 5*5 squares. All normal image considering 5*5 squares. All the the grains are visible but the noise content is grains are visible but noise level is still too too high, making the image useless. high. Adaptive thresholding has been applied to a Adaptive thresholding has been applied to the smoothed image considering 5*5 squares. The normal image considering 10*10 squares. noise is still quite high. Some grains look distorted but it is the best image obtained with a little noise. Another method commonly used sets the threshold point at a given percentage of pixels in the histogram. The histogram for the edge detector output is calculated and the values are summed starting from zero. When this sum exceeds a given percent of the total the threshold value is obtained. A good percentage to use is 50% for most edge detectors and images. This method was applied on 10*10 squares under the adaptive thresholding method. The image was thresholded at different percentages and the results are as shown.
  • 8. Image using 40% thresholding Image using 70% thresholding The noise content is too high in the first image and an attempt to reduce it by increasing the threshold results in a loss in details. The analysis of spots Suppose an image B(x, y) contains a single spot. By definition, this image contains a point (x0, y0) of maximum gray level. If polar co-ordinates centered upon (x0, y0) are established so that image is given by Bp (r1, theta) >= Bp (r2, theta) if r2>r1. B (x, y) is called a monotone spot of equality is not allowed in the above equation. This means that the gray level strictly decreases along a line extending out in any direction from the center point. An important special case occurs if all contours of a monotone spot are circles centered on the center point. This special case is called a concentric circular spot (CCS). To a good approximation, this usually describes the noise-free image of stars in a telescope, certain cells in a microscope and many other important things. The author has used an image of a CCS developed using Adobe Photoshop 6.0. The results are shown below.
  • 9. The spot developed using Adobe Photoshop 6.0 Spot profile function: scan line along the center showing the variation in intensity. Edge detection using Robert’s edge detector. Edge detection using contrast based edge Spot can be made out. detector. Very feeble broken lines are visible. Adaptive thresholding applied on image, Adaptive thresholding applied on image, thresholding being done at 75%. thresholding being done at 60%.
  • 10. Adaptive thresholding applied on image, Adaptive thresholding applied on image, thresholding being done at 50%. thresholding being done using histogram peak method. Global thresholding using 128 gray level. Output obtained using other detectors. Conclusion As evident, a spot can be best analyzed using the adaptive thresholding or by studying the spot profile function. Most other edge detectors fail to give a satisfactory result. References 1. Kenneth R. Castleman, Digital Image Processing, Prentice-Hall 1996 2. Dwayne Philips, Image Processing in C, 1995