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

Canny Edge Detection
Canny Edge DetectionCanny Edge Detection
Canny Edge DetectionSN Chakraborty
 
Image segmentation
Image segmentationImage segmentation
Image segmentationDeepak Kumar
 
Region based image segmentation
Region based image segmentationRegion based image segmentation
Region based image segmentationSafayet Hossain
 
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...Hemantha Kulathilake
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and SegmentationA B Shinde
 
Digital Image Fundamentals
Digital Image FundamentalsDigital Image Fundamentals
Digital Image FundamentalsA B Shinde
 
Image segmentation
Image segmentationImage segmentation
Image segmentationKuppusamy P
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationMostafa G. M. Mostafa
 
Lecture 1 for Digital Image Processing (2nd Edition)
Lecture 1 for Digital Image Processing (2nd Edition)Lecture 1 for Digital Image Processing (2nd Edition)
Lecture 1 for Digital Image Processing (2nd Edition)Moe Moe Myint
 
Image Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersImage Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersSuhaila Afzana
 
Comparative study on image segmentation techniques
Comparative study on image segmentation techniquesComparative study on image segmentation techniques
Comparative study on image segmentation techniquesgmidhubala
 
Digital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image FundamentalsDigital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image FundamentalsMostafa G. M. Mostafa
 
Image Representation & Descriptors
Image Representation & DescriptorsImage Representation & Descriptors
Image Representation & DescriptorsPundrikPatel
 
Line Detection using Hough transform .pptx
Line Detection using Hough transform .pptxLine Detection using Hough transform .pptx
Line Detection using Hough transform .pptxshubham loni
 
Module 31
Module 31Module 31
Module 31UllasSS1
 
Intensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringIntensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringShajun Nisha
 
Dip Image Segmentation
Dip Image SegmentationDip Image Segmentation
Dip Image SegmentationMubbasher Khaliq
 

What's hot (20)

Canny Edge Detection
Canny Edge DetectionCanny Edge Detection
Canny Edge Detection
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Region based image segmentation
Region based image segmentationRegion based image segmentation
Region based image segmentation
 
Image segmentation using wvlt trnsfrmtn and fuzzy logic. ppt
Image segmentation using wvlt trnsfrmtn and fuzzy logic. pptImage segmentation using wvlt trnsfrmtn and fuzzy logic. ppt
Image segmentation using wvlt trnsfrmtn and fuzzy logic. ppt
 
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
Digital Image Fundamentals
Digital Image FundamentalsDigital Image Fundamentals
Digital Image Fundamentals
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image Segmentation
 
Lecture 1 for Digital Image Processing (2nd Edition)
Lecture 1 for Digital Image Processing (2nd Edition)Lecture 1 for Digital Image Processing (2nd Edition)
Lecture 1 for Digital Image Processing (2nd Edition)
 
Image Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersImage Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain Filters
 
Comparative study on image segmentation techniques
Comparative study on image segmentation techniquesComparative study on image segmentation techniques
Comparative study on image segmentation techniques
 
Digital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image FundamentalsDigital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image Fundamentals
 
Image Representation & Descriptors
Image Representation & DescriptorsImage Representation & Descriptors
Image Representation & Descriptors
 
Line Detection using Hough transform .pptx
Line Detection using Hough transform .pptxLine Detection using Hough transform .pptx
Line Detection using Hough transform .pptx
 
Module 31
Module 31Module 31
Module 31
 
Intensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringIntensity Transformation and Spatial filtering
Intensity Transformation and Spatial filtering
 
Dip Image Segmentation
Dip Image SegmentationDip Image Segmentation
Dip Image Segmentation
 

Similar to Threshold Selection for Image segmentation

image-processing-husseina-ozigi-otaru.ppt
image-processing-husseina-ozigi-otaru.pptimage-processing-husseina-ozigi-otaru.ppt
image-processing-husseina-ozigi-otaru.pptRaviSharma65345
 
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
 
Hidden Surface Removal.pptx
Hidden Surface Removal.pptxHidden Surface Removal.pptx
Hidden Surface Removal.pptxbcanawakadalcollege
 
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
 
Final Review
Final ReviewFinal Review
Final ReviewAfzal Meeran
 
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
 
regions
regionsregions
regionsmjbahmani
 
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)

image-processing-husseina-ozigi-otaru.ppt
image-processing-husseina-ozigi-otaru.pptimage-processing-husseina-ozigi-otaru.ppt
image-processing-husseina-ozigi-otaru.ppt
 
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 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

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vĂĄzquez
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Recently uploaded (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

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