SlideShare a Scribd company logo
1 of 26
What is Image thresholding ?
• Thresholding is a technique for partitioning
image directly into region based on intensity
value and/or property of these value
– Because of intuitive property ,
– Simplicity of implementation
– Computational speed
• Image thresholding enjoys central place in image
segmentation
1
Intensity histogram that can be partitioned
(a) By a single threshold and ( b)by dual threshold
2
Thresholding - Foundation
• Suppose that the gray-level histogram
corresponds to an image, f(x,y), composed of
dark objects in a light background, in such a way
that object and background pixels have gray
levels grouped into two dominant modes.
• One obvious way to extract the objects from the
background is to select a threshold ‘T’ that
separates these modes. Then any point (x,y) for
which f(x,y) > T is called an object point,
otherwise, the point is called a background point.
3
Foundation (contd.)
• In such a case the histogram has to be partitioned
by multiple thresholds.
• Multilevel thresholding classifies a point (x,y) as
belonging to one object class
if T1 < (x,y) <= T2,
to the other object class
if f(x,y) > T2
and to the background
if f(x,y) <= T1.
4
Foundation (contd.)
0 ( , )
( , )
1 ( , )
f x y T
g x y
f x y T
 

 



Segmentation is accomplished by scanning the image pixel
by pixel and labeling each pixel as object or background,
depending on whether the grey level is greater or less than
the value of T .
Thresholding works well when a grey level histogram of the
image groups separates the pixels of the object and the
background into two dominant modes. Then a threshold T
can be easily chosen between the modes. 5
Basic Global and Local Thresholding
• Thresholding may be viewed as an operation that
involves tests against a function T of the form:
• T = T[x , y , p(x , y) , f(x , y)]
• Where f(x , y) is the gray level , and p(x , y) is some
local property.
• Simple thresholding schemes compare each pixels gray
level with a single global threshold. This is referred to
as Global Thresholding .
• If T depends on both f(x , y) and p(x , y) then this is
referred to a Local Thresholding .
6
Basic Global Thresholding
1. Select an initial estimate for T.
2. Segment the image using T. This well produce two groups
of pixels: G1 consisting of all pixels with gray level values>T
and G2 consisting of pixels with values <T.
3. Compute the average gray level values 1 and 2 for the
pixels in regions G1 and G2.
4. Compute a new threshold value: T = ½ [1 + 2 ]
5. Repeat step 2 through 4 until the difference in T in
successive iterations is smaller than a predefined
parameter , To.
7
Simulation result
8
Object Optimal Thresholding
• To minimize the average error in two or more over-lapped
pixel groups
9
Object Optimal Thresholding (contd.)
• Aim: Select T, that minimizes the average error in
decision.
— PDF of gray level of entire image:
p(z) = P1p1(z) + P2p2(z)
where, P1 & P2 are pixel probabilities of
background & foreground,
respectively.
p1(z) & p2(z) being their PDFs
10
Object Optimal Thresholding (contd.)
• Error probability in classifying background as
object :
• Error probability in classifying object as
background :
• Overall probability of error:
11
Object Optimal Thresholding (contd.)
• Threshold value for which the error is
minimal:
• Gaussian PDF is:
• Optimal threshold:
12
Optimum Thresholding: Otsu’s Method
• Based on a very simple idea: Find the
threshold that minimizes the weighted within-
class variance.
• This turns out to be the same as maximizing
the between-class variance.
• Operates directly on the gray level histogram
[e.g. 256 numbers, P(i)], so it’s fast (once the
histogram is computed).
13
Otsu Method: Assumptions
• Histogram (and the image) are bimodal.
• Assumes uniform illumination (implicitly), so
the bimodal brightness behavior arises from
object appearance differences only.
14
Otsu Method (contd.)
)
(
)
(
)
(
)
(
)
( 2
2
2
2
1
1
2
t
t
q
t
t
q
t
w 

 

q1(t)  P(i)
i 1
t
 



I
t
i
i
P
t
q
1
2 )
(
)
(
1(t) 
iP(i)
q1(t)
i 1
t
 2(t) 
iP(i)
q2(t )
i t 1
I

The weighted within-class variance is:
Where the class probabilities are estimated as:
And the class means are given by:
15
• The individual class variances are:
1
2
(t)  [i  1(t)]
2 P(i)
q1(t)
i1
t

2
2
(t)  [i  2(t)]
2 P(i)
q2 (t)
it1
I

Otsu Method (contd.)
2
 w
2
(t) q1(t)[1 q1 (t)][1(t) 2 (t)]2
Within-class,
from before Between-class
• Total Variance is:
16
Otsu Method (contd.)
Example:
6-level Gray scale Image
Result:-
17
Threshold T = 0 T = 1 T = 2 T = 3 T = 4 T = 5
3.1196 1.5268 0.5561 0.4909 0.9779 2.2491
0 1.5928 2.5635 2.6278 2.1417 0.8705
)
(
2
t
w

)
(
2
t
B

Variable Thresholding On Local Image Property
• Compute a threshold at every point (x,y) in the image based on specified
local property of neighbourhood of (x,y) .
• The basic approach to local thresholding using standard deviation and
mean of the pixel in a neighbourhood of every point in the image
• Standard deviation = local contrast
• Mean= average intensity.
• Local threshold
Txy = a σxy + b mxy
– The segmented image computed as
1 if f(x,y )>Txy
g(x,y) =
0 if f(x,y )≤Txy
18
Local Thresholding using Moving Averages
• Special case of local thresholding method.
• Computing a moving average along scan lines
of an image.
• Scanning carried out line by line in zigzag
pattern to reduce illumination bias.
19
Local Thresholding using Moving
Averages (contd.)
• Let Zk+1 intensity of the point at step k+1 in the
scanning sequence.
• The moving average(mean) at this point is given by
=m(k)+1/n(zk+1-zk-n)
– n= number of points used in computing the average
– m(1)=z1/n.
• This algorithm is intialized only once not at every row,
because moving average is computed for every point in
the image.
20
Local Thresholding using Moving
Averages (contd.)
• Segmentation is implemented using
1 if f(x,y )>Txy
g(x,y) =
0 if f(x,y )≤Txy
– with Txy=bmxy where b is constant and mxy is
the moving average from eq. at point (x,y )
in the input image
21
Let n=5 times the average stroke width .
In this case, average pixel width = 4, hence n=20 and b= 0.5
Local Thresholding using Moving
Averages (contd.)
22
Thresholding based on moving averages works well when the objects of
interest are small with respect to the image size.
Example- Images of typed or handwritten text.
Local Thresholding using Moving
Averages (contd.)
23
Applications of Thresholding
• Analyze and recognize fingerprints
• During the process of
recovering/analyzing/recognizing photographed
or scanned letters
• Reduce amount of information (e.g. for image
transfer, or content recognition)
• Real-time adaptive thresholding (e.g. face
detection)
• Traffic control and wireless mesh networks
• Motion detection using dynamic thresholding
• Background subtraction (e.g. real-time
subtraction for biometric face detection) 24
Conclusion
• Global thresholding: Suitable only when object &
background class are distinctive.
• Optimal Thresholding using Otsu’s method:
Requires maximizing the between class variance
between the object & background class.
• Otsu’s method fails due to improper illumination
on the image.
• Local thresholding using moving average is
suitable for thresholding the hand written text
images
25
26

More Related Content

Similar to IR.pptx

Similar to IR.pptx (20)

Im seg04
Im seg04Im seg04
Im seg04
 
ImSeg04 (2).ppt
ImSeg04 (2).pptImSeg04 (2).ppt
ImSeg04 (2).ppt
 
PPT s08-machine vision-s2
PPT s08-machine vision-s2PPT s08-machine vision-s2
PPT s08-machine vision-s2
 
4.intensity transformations
4.intensity transformations4.intensity transformations
4.intensity transformations
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Final Review
Final ReviewFinal Review
Final Review
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
ImageSegmentation (1).ppt
ImageSegmentation (1).pptImageSegmentation (1).ppt
ImageSegmentation (1).ppt
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.ppt
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.ppt
 
Image enhancement ppt nal2
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2
 
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
 
Otsu binarization
Otsu binarizationOtsu binarization
Otsu binarization
 
Digital Image Procesing
Digital Image ProcesingDigital Image Procesing
Digital Image Procesing
 
N018219199
N018219199N018219199
N018219199
 
Image processing
Image processingImage processing
Image processing
 
Image Segmentation.ppt
Image Segmentation.pptImage Segmentation.ppt
Image Segmentation.ppt
 
AUTOMATIC THRESHOLDING TECHNIQUES FOR OPTICAL IMAGES
AUTOMATIC THRESHOLDING TECHNIQUES FOR OPTICAL IMAGESAUTOMATIC THRESHOLDING TECHNIQUES FOR OPTICAL IMAGES
AUTOMATIC THRESHOLDING TECHNIQUES FOR OPTICAL IMAGES
 
ModuleII.ppt
ModuleII.pptModuleII.ppt
ModuleII.ppt
 

Recently uploaded

Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...RohitNehra6
 
Recombination DNA Technology (Microinjection)
Recombination DNA Technology (Microinjection)Recombination DNA Technology (Microinjection)
Recombination DNA Technology (Microinjection)Jshifa
 
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptxSOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptxkessiyaTpeter
 
Module 4: Mendelian Genetics and Punnett Square
Module 4:  Mendelian Genetics and Punnett SquareModule 4:  Mendelian Genetics and Punnett Square
Module 4: Mendelian Genetics and Punnett SquareIsiahStephanRadaza
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​kaibalyasahoo82800
 
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡anilsa9823
 
Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |aasikanpl
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxSwapnil Therkar
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real timeSatoshi NAKAHIRA
 
Scheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxScheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxyaramohamed343013
 
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.PraveenaKalaiselvan1
 
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...anilsa9823
 
Work, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE PhysicsWork, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE Physicsvishikhakeshava1
 
A relative description on Sonoporation.pdf
A relative description on Sonoporation.pdfA relative description on Sonoporation.pdf
A relative description on Sonoporation.pdfnehabiju2046
 
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Sérgio Sacani
 
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsHubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsSérgio Sacani
 
TOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsTOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsssuserddc89b
 
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCESTERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCEPRINCE C P
 

Recently uploaded (20)

Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...
 
Recombination DNA Technology (Microinjection)
Recombination DNA Technology (Microinjection)Recombination DNA Technology (Microinjection)
Recombination DNA Technology (Microinjection)
 
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptxSOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
 
Module 4: Mendelian Genetics and Punnett Square
Module 4:  Mendelian Genetics and Punnett SquareModule 4:  Mendelian Genetics and Punnett Square
Module 4: Mendelian Genetics and Punnett Square
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​
 
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
 
Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real time
 
Scheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxScheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docx
 
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
 
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
 
Work, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE PhysicsWork, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE Physics
 
A relative description on Sonoporation.pdf
A relative description on Sonoporation.pdfA relative description on Sonoporation.pdf
A relative description on Sonoporation.pdf
 
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
 
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsHubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
 
9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service
9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service
9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service
 
TOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsTOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physics
 
Engler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomyEngler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomy
 
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCESTERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
 

IR.pptx

  • 1. What is Image thresholding ? • Thresholding is a technique for partitioning image directly into region based on intensity value and/or property of these value – Because of intuitive property , – Simplicity of implementation – Computational speed • Image thresholding enjoys central place in image segmentation 1
  • 2. Intensity histogram that can be partitioned (a) By a single threshold and ( b)by dual threshold 2
  • 3. Thresholding - Foundation • Suppose that the gray-level histogram corresponds to an image, f(x,y), composed of dark objects in a light background, in such a way that object and background pixels have gray levels grouped into two dominant modes. • One obvious way to extract the objects from the background is to select a threshold ‘T’ that separates these modes. Then any point (x,y) for which f(x,y) > T is called an object point, otherwise, the point is called a background point. 3
  • 4. Foundation (contd.) • In such a case the histogram has to be partitioned by multiple thresholds. • Multilevel thresholding classifies a point (x,y) as belonging to one object class if T1 < (x,y) <= T2, to the other object class if f(x,y) > T2 and to the background if f(x,y) <= T1. 4
  • 5. Foundation (contd.) 0 ( , ) ( , ) 1 ( , ) f x y T g x y f x y T         Segmentation is accomplished by scanning the image pixel by pixel and labeling each pixel as object or background, depending on whether the grey level is greater or less than the value of T . Thresholding works well when a grey level histogram of the image groups separates the pixels of the object and the background into two dominant modes. Then a threshold T can be easily chosen between the modes. 5
  • 6. Basic Global and Local Thresholding • Thresholding may be viewed as an operation that involves tests against a function T of the form: • T = T[x , y , p(x , y) , f(x , y)] • Where f(x , y) is the gray level , and p(x , y) is some local property. • Simple thresholding schemes compare each pixels gray level with a single global threshold. This is referred to as Global Thresholding . • If T depends on both f(x , y) and p(x , y) then this is referred to a Local Thresholding . 6
  • 7. Basic Global Thresholding 1. Select an initial estimate for T. 2. Segment the image using T. This well produce two groups of pixels: G1 consisting of all pixels with gray level values>T and G2 consisting of pixels with values <T. 3. Compute the average gray level values 1 and 2 for the pixels in regions G1 and G2. 4. Compute a new threshold value: T = ½ [1 + 2 ] 5. Repeat step 2 through 4 until the difference in T in successive iterations is smaller than a predefined parameter , To. 7
  • 9. Object Optimal Thresholding • To minimize the average error in two or more over-lapped pixel groups 9
  • 10. Object Optimal Thresholding (contd.) • Aim: Select T, that minimizes the average error in decision. — PDF of gray level of entire image: p(z) = P1p1(z) + P2p2(z) where, P1 & P2 are pixel probabilities of background & foreground, respectively. p1(z) & p2(z) being their PDFs 10
  • 11. Object Optimal Thresholding (contd.) • Error probability in classifying background as object : • Error probability in classifying object as background : • Overall probability of error: 11
  • 12. Object Optimal Thresholding (contd.) • Threshold value for which the error is minimal: • Gaussian PDF is: • Optimal threshold: 12
  • 13. Optimum Thresholding: Otsu’s Method • Based on a very simple idea: Find the threshold that minimizes the weighted within- class variance. • This turns out to be the same as maximizing the between-class variance. • Operates directly on the gray level histogram [e.g. 256 numbers, P(i)], so it’s fast (once the histogram is computed). 13
  • 14. Otsu Method: Assumptions • Histogram (and the image) are bimodal. • Assumes uniform illumination (implicitly), so the bimodal brightness behavior arises from object appearance differences only. 14
  • 15. Otsu Method (contd.) ) ( ) ( ) ( ) ( ) ( 2 2 2 2 1 1 2 t t q t t q t w      q1(t)  P(i) i 1 t      I t i i P t q 1 2 ) ( ) ( 1(t)  iP(i) q1(t) i 1 t  2(t)  iP(i) q2(t ) i t 1 I  The weighted within-class variance is: Where the class probabilities are estimated as: And the class means are given by: 15
  • 16. • The individual class variances are: 1 2 (t)  [i  1(t)] 2 P(i) q1(t) i1 t  2 2 (t)  [i  2(t)] 2 P(i) q2 (t) it1 I  Otsu Method (contd.) 2  w 2 (t) q1(t)[1 q1 (t)][1(t) 2 (t)]2 Within-class, from before Between-class • Total Variance is: 16
  • 17. Otsu Method (contd.) Example: 6-level Gray scale Image Result:- 17 Threshold T = 0 T = 1 T = 2 T = 3 T = 4 T = 5 3.1196 1.5268 0.5561 0.4909 0.9779 2.2491 0 1.5928 2.5635 2.6278 2.1417 0.8705 ) ( 2 t w  ) ( 2 t B 
  • 18. Variable Thresholding On Local Image Property • Compute a threshold at every point (x,y) in the image based on specified local property of neighbourhood of (x,y) . • The basic approach to local thresholding using standard deviation and mean of the pixel in a neighbourhood of every point in the image • Standard deviation = local contrast • Mean= average intensity. • Local threshold Txy = a σxy + b mxy – The segmented image computed as 1 if f(x,y )>Txy g(x,y) = 0 if f(x,y )≤Txy 18
  • 19. Local Thresholding using Moving Averages • Special case of local thresholding method. • Computing a moving average along scan lines of an image. • Scanning carried out line by line in zigzag pattern to reduce illumination bias. 19
  • 20. Local Thresholding using Moving Averages (contd.) • Let Zk+1 intensity of the point at step k+1 in the scanning sequence. • The moving average(mean) at this point is given by =m(k)+1/n(zk+1-zk-n) – n= number of points used in computing the average – m(1)=z1/n. • This algorithm is intialized only once not at every row, because moving average is computed for every point in the image. 20
  • 21. Local Thresholding using Moving Averages (contd.) • Segmentation is implemented using 1 if f(x,y )>Txy g(x,y) = 0 if f(x,y )≤Txy – with Txy=bmxy where b is constant and mxy is the moving average from eq. at point (x,y ) in the input image 21
  • 22. Let n=5 times the average stroke width . In this case, average pixel width = 4, hence n=20 and b= 0.5 Local Thresholding using Moving Averages (contd.) 22
  • 23. Thresholding based on moving averages works well when the objects of interest are small with respect to the image size. Example- Images of typed or handwritten text. Local Thresholding using Moving Averages (contd.) 23
  • 24. Applications of Thresholding • Analyze and recognize fingerprints • During the process of recovering/analyzing/recognizing photographed or scanned letters • Reduce amount of information (e.g. for image transfer, or content recognition) • Real-time adaptive thresholding (e.g. face detection) • Traffic control and wireless mesh networks • Motion detection using dynamic thresholding • Background subtraction (e.g. real-time subtraction for biometric face detection) 24
  • 25. Conclusion • Global thresholding: Suitable only when object & background class are distinctive. • Optimal Thresholding using Otsu’s method: Requires maximizing the between class variance between the object & background class. • Otsu’s method fails due to improper illumination on the image. • Local thresholding using moving average is suitable for thresholding the hand written text images 25
  • 26. 26

Editor's Notes

  1. Fig (b ) a distint valley