Copyright © 2012 Elsevier Inc. All rights reserved.. Chapter 4 Thresholding Techniques.

Slides:



Advertisements
Similar presentations
5th Intensive Course on Soil Micromorphology Naples th - 14th September Image Analysis Lecture 5 Thresholding/Segmentation.
Advertisements

5th Intensive Course on Soil Micromorphology Naples th - 14th September Image Analysis Lecture 5 Thresholding/Segmentation.
Robust statistical method for background extraction in image segmentation Doug Keen March 29, 2001.
Chapter 3 Image Enhancement in the Spatial Domain.
Lecture 5 Automatic Thresholding. 2 Edge Detection Methods  Separate Background vs. Foreground Gaussian Noise  noisy signal  Most automatic thresholding.
E.G.M. PetrakisImage Segmentation1 Segmentation is the process of partitioning an image into regions –region: group of connected pixels with similar properties.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. Lecture Slides Elementary Statistics Eleventh Edition and the Triola.
Automatic Histogram Threshold Using Fuzzy Measures 呂惠琪.
Automatic Thresholding
Slide Slide 1 Copyright © 2007 Pearson Education, Inc Publishing as Pearson Addison-Wesley. Lecture Slides Elementary Statistics Tenth Edition and the.
Image Segmentation Image segmentation (segmentace obrazu) –division or separation of the image into segments (connected regions) of similar properties.
Lecture 07 Segmentation Lecture 07 Segmentation Mata kuliah: T Computer Vision Tahun: 2010.
電腦視覺 Computer and Robot Vision I Chapter2: Binary Machine Vision: Thresholding and Segmentation Instructor: Shih-Shinh Huang 1.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Lecture 6 Image Segmentation
EE 7730 Image Segmentation.
Thresholding Otsu’s Thresholding Method Threshold Detection Methods Optimal Thresholding Multi-Spectral Thresholding 6.2. Edge-based.
Segmentation Divide the image into segments. Each segment:
Image Segmentation. Introduction The purpose of image segmentation is to partition an image into meaningful regions with respect to a particular application.
MSU CSE 803 Stockman Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute.
CS 376b Introduction to Computer Vision 02 / 25 / 2008 Instructor: Michael Eckmann.
Image Enhancement.
Segmentation (Section 10.3 & 10.4) CS474/674 – Prof. Bebis.
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 6-1 Chapter 6 The Normal Distribution and Other Continuous Distributions.
MSU CSE 803 Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute some result.
Thresholding Thresholding is usually the first step in any segmentation approach We have talked about simple single value thresholding already Single value.
DIGITAL IMAGE PROCESSING Instructors: Dr J. Shanbehzadeh M.Yekke Zare M.Yekke Zare ( J.Shanbehzadeh M.Yekke Zare )
CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann.
Chapter 10: Image Segmentation
GmImgProc Alexandra Olteanu SCPD Alexandru Ştefănescu SCPD.
Copyright © 2012 Elsevier Inc. All rights reserved.. Chapter 5 Edge Detection.
S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014.
CS 6825: Binary Image Processing – binary blob metrics
University of Kurdistan Digital Image Processing (DIP) Lecturer: Kaveh Mollazade, Ph.D. Department of Biosystems Engineering, Faculty of Agriculture,
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 6 Normal Probability Distributions 6-1 Review and Preview 6-2 The Standard Normal.
Digital Image Processing
Digital Image Processing Lecture 18: Segmentation: Thresholding & Region-Based Prof. Charlene Tsai.
Chapter 10 Image Segmentation.
Chapter 10, Part II Edge Linking and Boundary Detection The methods discussed in the previous section yield pixels lying only on edges. This section.
Digital Image Processing Lecture 10: Image Restoration March 28, 2005 Prof. Charlene Tsai.
CS654: Digital Image Analysis
Digital Image Processing Lecture 10: Image Restoration
CSC508 Convolution Operators. CSC508 Convolution Arguably the most fundamental operation of computer vision It’s a neighborhood operator –Similar to the.
Image Segmentation by Histogram Thresholding Venugopal Rajagopal CIS 581 Instructor: Longin Jan Latecki.
Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding.
3.7 Adaptive filtering Joonas Vanninen Antonio Palomino Alarcos.
主講者 : 陳建齊. Outline & Content 1. Introduction 2. Thresholding 3. Edge-based segmentation 4. Region-based segmentation 5. conclusion 2.
Digital Image Processing
Ch 8.2: Improvements on the Euler Method Consider the initial value problem y' = f (t, y), y(t 0 ) = y 0, with solution  (t). For many problems, Euler’s.
Machine Vision ENT 273 Regions and Segmentation in Images Hema C.R. Lecture 4.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
Thresholding Foundation:. Thresholding In A: light objects in dark background To extract the objects: –Select a T that separates the objects from the.
Copyright © 2016 Brooks/Cole Cengage Learning Intro to Statistics Part II Descriptive Statistics Intro to Statistics Part II Descriptive Statistics Ernesto.
Lecture z Chapter 10: Image Segmentation. Segmentation approaches 1) Gradient based: How different are pixels? 2) Thresholding: Converts grey-level images.
Slide 1 Copyright © 2004 Pearson Education, Inc.  Descriptive Statistics summarize or describe the important characteristics of a known set of population.
Digital Image Processing (DIP)
Chapter 10 Image Segmentation
Miguel Tavares Coimbra
Image Pre-Processing in the Spatial and Frequent Domain
IMAGE SEGMENTATION USING THRESHOLDING
Fiona E. Müllner, Sheyum Syed, Paul R. Selvin, Fred J. Sigworth 
Where did we stop? The Bayes decision rule guarantees an optimal classification… … But it requires the knowledge of P(ci|x) (or p(x|ci) and P(ci)) We.
پردازش تصاویر دیجیتال- احمدی فرد
6.2 Grid Search of Chi-Square Space
Chapter 10 – Image Segmentation
5.2 Least-Squares Fit to a Straight Line
Section 2-1 Review and Preview
Image Segmentation.
Stability of Cortical Responses and the Statistics of Natural Scenes
Essentials of Statistics 4th Edition
Presentation transcript:

Copyright © 2012 Elsevier Inc. All rights reserved.. Chapter 4 Thresholding Techniques

4.1 Introduction One of the first tasks to be undertaken in vision applications is to segment objects from their backgrounds. Segmentation is actually one of the central and most difficult practical problems of machine vision. In practical situations, there is clearly a tension between simple cost-effective solutions and general-purpose but more computationally expensive solutions. Copyright © 2012 Elsevier Inc. All rights reserved.. 2

4.3 Thresholding Finding a Suitable Threshold The technique that is most frequently employed for determining thresholds involves analyzing the histogram of intensity levels of images. If a significant minimum is found, it is interpreted as the required threshold value. Copyright © 2012 Elsevier Inc. All rights reserved.. 3

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.1

Basic Global Thresholding The following algorithm can be used to obtain T automatically: 1.Select an initial estimate for T. 2.Segment the image using T. This will produce two groups of pixels: G 1 consisting of all pixels with gray level > T and G 2 consisting of pixels with values ≦ T. 3.Compute the average gray level value μ 1 and μ 2 for the pixels in regions G 1 and G 2.

Basic Global Thresholding 4.Compute a new threshold value: 5.Repeat step 2 though 4 until the difference in T in successive iterations is smaller than a predefined parameter T 0.

Chapter 10 Image Segmentation Chapter 10 Image Segmentation

Difficulties: The valley may be so broad that it is difficult to locate a significant minimum. There may be a number of minima because of the type of detail in the image, and selecting one minimum will be difficult. Noise within the valley may inhibit location of the optimum position. There may be no clearly visible valley. The major peaks in the histogram may be much larger than the other and bias the position of minimum. Multimodal histogram. Copyright © 2012 Elsevier Inc. All rights reserved.. 8

4.3.2 Tackling the Problem of Bias in Threshold Selection A good strategy is to find position in the image where there is a significant intensity gradient – corresponding to pixels in the regions of edge – and to analyze the intensity values of these locations while ignoring other points in the image. Scattergram: pixel properties are plotted on a 2- D map with intensity variation along one axis and intensity gradient magnitude variation along the other. Copyright © 2012 Elsevier Inc. All rights reserved.. 9

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.2

Finding a Valley in the Intensity Distribution We can try weighting the plots in the intensity histogram in such a way as to minimize threshold bias in order to locate accurately the valley in the intensity distribution. A simple strategy is first to locate all pixels that have a significant intensity gradient, and then to find the intensity histogram not only of these pixels but also of nearby pixels. Reference: Weska et al Copyright © 2012 Elsevier Inc. All rights reserved.. 11

Copyright © 2012 Elsevier Inc. All rights reserved.. 12

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.3

Copyright © 2012 Elsevier Inc. All rights reserved.. 14

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.4

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.5 A picture with more ideal properties. (a) Image of a plug that has been lit fairly uniformly. The histogram (c) approximates to the ideal form, and the result of thresholding (b) is acceptable. However, much of the structure of the plug is lost during binarization.

4.4 Adaptive Thresholding Three general approaches of adaptive thresholding: 1.One involves modeling the background within the image. 2.Another is to work out a local threshold vale for each pixel by examining the range of intensities in its neighborhood. 3.A third approach is to split the image into subimages and deal with them independently. Copyright © 2012 Elsevier Inc. All rights reserved.. 17

Local Thresholding Method T=mean-(maximum-mean) or T=mean-k(maximum-mean) k may be as low as 0.5 Copyright © 2012 Elsevier Inc. All rights reserved.. 18

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.6

Copyright © 2012 Elsevier Inc. All rights reserved.. Table 4.1

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.7 Effectiveness of local thresholding on printed text. Here, a simple local thresholding procedure (Table 4.1), operating within a 333 neighborhood, is used to binarize the image of a piece of printed text (a). Despite the poor illumination, binarization is performed quite effectively (b). Note the complete absence of isolated noise points in (b), while by contrast the dots on all the i¡¦s are accurately reproduced. The best that could be achieved by uniform thresholding is shown in (c).

4.5 More Thoroughgoing Approaches Variance-Based Thrsholding The image intensity histogram is analyzed to find where it can best be partitioned to optimize criteria based on ratios of the within-class, between-class, and total variance. Reference: Otsu, 1979 The number of pixels with gray level i is written as n i. The total number of pixels in the image is N=n 1 +n 2 +…+n L Copyright © 2012 Elsevier Inc. All rights reserved.. 22

FORMULA Copyright © 2012 Elsevier Inc. All rights reserved.. 23 The probability of a pixel having gray level i is: where For ranges of intensities up to and above the threshold value k, Between-class variance is Total variance: where

FORMULA Copyright © 2012 Elsevier Inc. All rights reserved.. 24 Eq. (4-6) can be simplified to: The Goal is to maximize The ratio of the Between-class variance To the total variance: However, the total variance is constant for a given image histogram, so maximizing the ratio simplifies to maximizing the between-class variance.

4.5.2 Entropy-Based Thresholding Entropy is a measure of disorder, and is zero for a perfectly ordered system. The concept of entropy thresholding is to threshold at an intensity for which the sum of the entropies of the two intensity probability distributions thereby separated is maximized. Copyright © 2012 Elsevier Inc. All rights reserved.. 25

The intensity distribution is divided into two classes A and B due to the threshold value k: Copyright © 2012 Elsevier Inc. All rights reserved.. 26

FORMULA Copyright © 2012 Elsevier Inc. All rights reserved.. 27 The entropies for each class are given by: Total Entropy: Thus

Maximizing the total entropy H(k), we obtain the best threshold value k. Reference: Hannah et al., 1995 Copyright © 2012 Elsevier Inc. All rights reserved.. 28

4.5.3 Maximum Likelihood Thresholding Model the training set data using a known distribution function such as a Gaussian. Applying the respective a priori class probabilities P1 and P2, careful analysis shows that the condition p1(x)=p2(x) reduces to the form: Copyright © 2012 Elsevier Inc. All rights reserved.. 29

FORMULA Copyright © 2012 Elsevier Inc. All rights reserved.. 30

4.6 The Global Valley Approach to Thresholding The global valley approach aimed to provide a rigorous means of going back to basics to find global valleys of intensity histograms in such a way as to embody the intrinsic meaning of the data. For any potential global valley point j, we need to look at all points i on the left of j to find the highest peak to the left and all points k on the right of j to find the highest peak to the right. Copyright © 2012 Elsevier Inc. All rights reserved.. 31

FORMULA Copyright © 2012 Elsevier Inc. All rights reserved.. 32 Define s(u)=u, if u>0, and s(u)=0, if u<=0

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.8 Result of applying global minimization algorithm to 1-D data sets. (a) A basic two-peak structure. (b) A basic multimode structure. Top trace: original 1-D data sets. Middle trace: results from Eq. (4.23). Bottom trace: results from Eq. (4.24). Source: © IET 2008

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.9 (1/2)

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.9 (2/2) FIGURE 4.9 Result of applying the global valley algorithm to a multimode intensity distribution. (a) Original grayscale image. (b) Reconstituted image after multiple thresholding using the eight peaks in the output distribution. (d) Top: original intensity histogram for (a). Middle: result of applying the global valley transformation. Bottom: result of smoothing. The eight short vertical lines at the very bottom indicate the peak positions. In (d), the intensity scale is 0255; the vertical scale is normalized to a maximum height indicated by the height of the vertical axis. Note: the three traces are computed 25 times more accurately than the rounded values displayed, so the peak locations are determined as accurately as indicated. For comparison, (c)shows the result of applying the between-class variance method to the same image: the eight thresholds are indicated by vertical lines in the top trace of (d). Source: © IET 2008

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.10 (1/3)

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.10 (2/3)

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.10 (3/3) FIGURE 4.10 Multilevel thresholding of the Lena image. For the original Lena grayscale image, see ¡¥Miscellaneous¡¦ at the USC-SIPI Image Database*. (a) Result of applying the between-class variance method (BCVM) to original image. (b)(d) Results of applying the global valley method to original image, producing, respectively, bilevel, tri-level, and five-level images. (e) Top: intensity histogram of original image: the vertical line indicates the bi-level threshold selected by the BCVM. Bottom: the resulting K distribution. (f)(h) The upper traces show smoothed versions of the K distribution, with short vertical lines indicating, respectively, one, two, or four threshold positions; the lower traces show threshold positions resulting from progressive smoothing of the K distribution: note that these are scaled and some are truncated as indicated by the horizontal gray line at the top; the horizontal dotted lines show how sets of threshold values are selected automatically (see text). Source: © IET 2008

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.11 (1/2) scan = 0; do { numberofpeaks = 0; for (all intensity values in distribution) { if (peak found) { peakposition[scan, numberofpeaks] = intensity; numberofpeaks ++; } if (numberofpeaks == requirednumber) { if (previousnumberofpeaks > numberofpeaks) lowestscan = scan; else highestscan = scan; } previousnumberofpeaks = numberofpeaks; apply incremental smoothing kernel to distribution; scan ++; } while (numberofpeaks > 0); optimumscan = (lowestscan*3 + highestscan)/4; for (all peaks up to requirednumber) bestpeakposition[peak] = peakposition[optimumscan, peak];

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.11 (2/2) FIGURE 4.11 Basic global valley algorithm. This version of the algorithm assumes that the required number of peaks (required number) is known in advance, although the optimum amount of smoothing is unknown. Here, the latter is estimated by taking a weighted mean of the lowest and highest numbers of smoothing scans that yield the required number of peaks. The final line of the algorithm gives the required number of peaks in the best positions. While this form of the algorithm obtains positions for a specific required number of peaks, the underlying process also maps out a complete set of stability graphs because it proceeds until the number of peaks is zero. For further details, see Section 4.7. Source: © IET 2008

Copyright © 2012 Elsevier Inc. All rights reserved.. FIGURE 4.12

4.10 More Recent Developments Coudray et al., 2010 Medina-Carnicer et al., 2011, Davies, 2007a, 2008b Li et al., 2011 Ng, 2006 Copyright © 2012 Elsevier Inc. All rights reserved.. 42