SlideShare a Scribd company logo
Digital Image processing
Assoc. Prof. Elham Shawky Salama Omer
Faculty of Computers, and Artificial Intelligence
Cairo University - Egypt.
Image Segmentation
Part-3 “Thresholding and Region
Based Methods ”
2
Image segmentation methods
Image Segmentation
Boundary-Based
(Discontinuity)
(1) Detection of
Discontinuities
Point detection
Line detection
Edge detection
Edge linking and
boundary detection
(2) Local Processing
Global Processing (3) Hough Transform
Region –based
(Similarity)
(5) Thresholding
(6)Region growing
(7) Region splitting
and merge
3
4
Image Segmentation
Thresholding
Light objects in dark background
To extract the objects:
Select a T that separates the objects
from the background
i.e. So: (x,y) belongs:
To object class
if f(x,y)>T
To the background
if f(x,y)≤T
5
Image Segmentation
Thresholding
 A more general case of this approach (multilevel
thresholding)
So: (x,y) belongs:
To First object class
if T1<f(x,y)≤T2
To the other object
if f(x,y)>T2
To the background
if f(x,y)≤T1
• To partition the image histogram by using a single
threshold T.
• Then the image is scanned and labels are assigned.
• This technique is successful in highly controlled
environments.
Image Segmentation
Simple global Thresholding






T
y
x
f
T
y
x
f
y
x
g
)
,
(
if
0
)
,
(
if
1
)
,
(
7
8
9
• Based on the histogram of an image
• Partition the image histogram using a single global threshold
• The success of this technique very strongly depends on how
well the histogram can be partitioned
Image Segmentation
Simple global Thresholding
10
• Imagine a poker playing robot that needs to visually interpret the
cards in its hand
Original Image Thresholded Image
Image Segmentation
Simple global Thresholding
11
• If you get the threshold wrong the results can be disastrous
Threshold Too Low Threshold Too High
Image Segmentation
Simple global Thresholding
12
Thresholding
Optimal Global and Adaptive Thresholding
• This method treats pixel values as probability density functions.
• The goal of this method is to minimize the probability of
misclassifying pixels as either object or background.
• There are two kinds of error:
• mislabeling an object pixel as background, and
• mislabeling a background pixel as object.
13
 Assume the image consists of the objects and background, where
the objects occupy P1 of the pixels (P1+P2=1).
 Assume both objects and background are subject to a Normal
distribution
 By the total probability rule, the image is with the following
density function:
14
 Let T be the threshold. The mis-segmentation takes place
in two cases:
Background pixels miss-classified into object
pixels: the error probability (or the number of errors) is E1
Object pixels miss-classified into background pixels: the
error probability (or the number of errors) is E2
The total mis-segmentation error is
15
If the s.d. are the same and P1=P2=1/2:
If the s.d. are the same:
16
An algorithm used to obtain T automatically for
global thresholding
1. Draw image histogram
2. Compute the average gray level values 1 and 2 for the
pixels in regions G1 and G2.
3. Compute a threshold value: T = ½[1 + 2 ]
4. Compute the binary image g(x,y)






T
y
x
f
T
y
x
f
y
x
g
)
,
(
if
0
)
,
(
if
1
)
,
(
Image Segmentation
Region Based Segmentation
18
• Edges and thresholds sometimes do not give good
results for segmentation.
• Region-based segmentation is based on the
connectivity of similar pixels in a region.
• There are two main approaches to region-based
segmentation: region growing and region splitting.
Image Segmentation
Region Based Segmentation
19
Region-Based Segmentation
Basic Formulation
• Let R represent the entire image region.
• Segmentation is a process that partitions R into subregions,
R1,R2,…,Rn, such that
R
Ri
n
i


1
(a)
j
i
j
i
R
R j
i 

 ,
and
all
for
(c) 
n
i
Ri ,...,
2
,
1
region,
connected
a
is
(b) 
n
i
R
P i ,...,
2
,
1
for
TRUE
)
(
(d) 

j
i
j
i R
R
R
R
P and
regions
adjacent
any
for
FALSE
)
(
(e) 

20
Region-Based Segmentation
Region Growing
• Fig. 10.41 shows the histogram of Fig. 10.40 (a). It is difficult to
segment the defects by thresholding methods. (Applying region
growing methods are better in this case.)
Figure 10.41
Figure 10.40(a)
21
Region-Based Segmentation Region Growing
22
 Problems:
• Starting with a single seed and letting this region grow completely
before trying other seeds basis the segmentation in favor of the
region which are segmented first
• Different choices of seeds may give different segmentation results
• Problems can occur if the (arbitrary chosen) seed points lies on an
edge
Suggested Algorithms and solutions:
• No Single region is allowed to completely dominate the proceedings
• A number of regions are allowed to grow at the same time
Region-Based Segmentation Region Growing
23
Region-Based Segmentation
Region Growing Algorithm
1. Start with a set of seed points and from these grows regions
by appending to each seed point those neighboring pixel that
have similar properties
2. If the absolute difference between the neighbor grey level and
the seed pixel's grey level is less than a threshold ,add this
pixel to the region,
3. Repeat until all pixels are assigned to regions
Designing issues:
Seed selection
Selection of suitable properties for including points in the various
regions (similarity criteria)
24
Region-Based Segmentation Region Growing
25
Region-Based Segmentation
Region Splitting and Merging
• Region splitting is the opposite of region growing.
• First there is a large region (possible the entire image).
• Then a predicate (measurement) is used to determine if the
region is uniform.
• If not, then the method requires that the region be split
into two regions.
• Then each of these two regions is independently tested by
the predicate (measurement).
• This procedure continues until all resulting regions are
uniform.
26
Region-Based Segmentation
Region Splitting
• The main problem with region splitting is determining where to
split a region.
• One method to divide a region is to use a quadtree structure.
• Quadtree: a tree in which nodes have exactly four descendants.
27
28
Region-Based Segmentation
Region Merging and Splitting Algorithm
1. Start with the whole image as a single suggested region
2. For each region
1. Compute the variance
2. If
1. then split regions into a set of regions consider these regions as
suggested regions for the next iteration
2. Else, flag the region as a found region R that will not be split any more
Next iteration
Repeated steps until all suggested regions are flagged as regions
After That
There may be more than one region needed to be merged to constitude one
region
2
( )
R T
 
29
Start merging as follow:
1. For each neighbor region R1,R2 Check the following conditions
2. Then merge R1and R2
3. Apply this iteratively
1 1 2 2
2
1 2
| ( ) ( )|
&
( )
R R S
R R T
 

 
 

More Related Content

PPT
ppt on region segmentation by AJAY KUMAR SINGH (NITK)
PPT
Ajay ppt region segmentation new copy
PDF
Image segmentation
PPTX
Region based segmentation
PDF
SIRG-BSU_3_used-important.pdf
PPT
Image segmentation
PPT
digital imagesegmentation-191212120951.ppt
ppt on region segmentation by AJAY KUMAR SINGH (NITK)
Ajay ppt region segmentation new copy
Image segmentation
Region based segmentation
SIRG-BSU_3_used-important.pdf
Image segmentation
digital imagesegmentation-191212120951.ppt

Similar to Lecture 8_Image Segmentation_3_dip__.pdf (20)

PDF
IRJET- Image Segmentation Techniques: A Review
PPT
regions
PDF
Different Image Segmentation Techniques for Dental Image Extraction
PPTX
image segmentation by Rajesh
PPTX
IMAGE SEGMENTATION TECHNIQUES
PPT
Segmentation of Image practical applications.ppt
PPTX
Image Segmentation in computer vision.pptx
PPT
ImSeg04 (2).ppt
PPT
ImSeg04.ppt
PPT
Im seg04
PPTX
Segmentation is preper concept to hands.pptx
PPTX
Region based image segmentation
PPTX
Global Thresholding Machine Learning Example
PDF
imagesegmentationppt-120409061123-phpapp01 (2).pdf
PDF
imagesegmentationppt-120409061123-phpapp01 (2).pdf
PDF
Bx4301429434
PDF
Review of Image Segmentation Techniques based on Region Merging Approach
PDF
Region Splitting and Merging Technique For Image segmentation.
PPTX
Region based segmentation
PPTX
region Basd in ML
IRJET- Image Segmentation Techniques: A Review
regions
Different Image Segmentation Techniques for Dental Image Extraction
image segmentation by Rajesh
IMAGE SEGMENTATION TECHNIQUES
Segmentation of Image practical applications.ppt
Image Segmentation in computer vision.pptx
ImSeg04 (2).ppt
ImSeg04.ppt
Im seg04
Segmentation is preper concept to hands.pptx
Region based image segmentation
Global Thresholding Machine Learning Example
imagesegmentationppt-120409061123-phpapp01 (2).pdf
imagesegmentationppt-120409061123-phpapp01 (2).pdf
Bx4301429434
Review of Image Segmentation Techniques based on Region Merging Approach
Region Splitting and Merging Technique For Image segmentation.
Region based segmentation
region Basd in ML
Ad

Recently uploaded (20)

PPTX
master seminar digital applications in india
PDF
RMMM.pdf make it easy to upload and study
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Cell Types and Its function , kingdom of life
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
01-Introduction-to-Information-Management.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Institutional Correction lecture only . . .
master seminar digital applications in india
RMMM.pdf make it easy to upload and study
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Complications of Minimal Access Surgery at WLH
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Microbial disease of the cardiovascular and lymphatic systems
STATICS OF THE RIGID BODIES Hibbelers.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
human mycosis Human fungal infections are called human mycosis..pptx
PPH.pptx obstetrics and gynecology in nursing
Microbial diseases, their pathogenesis and prophylaxis
VCE English Exam - Section C Student Revision Booklet
Cell Types and Its function , kingdom of life
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
01-Introduction-to-Information-Management.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Final Presentation General Medicine 03-08-2024.pptx
TR - Agricultural Crops Production NC III.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Institutional Correction lecture only . . .
Ad

Lecture 8_Image Segmentation_3_dip__.pdf

  • 1. Digital Image processing Assoc. Prof. Elham Shawky Salama Omer Faculty of Computers, and Artificial Intelligence Cairo University - Egypt.
  • 2. Image Segmentation Part-3 “Thresholding and Region Based Methods ” 2
  • 3. Image segmentation methods Image Segmentation Boundary-Based (Discontinuity) (1) Detection of Discontinuities Point detection Line detection Edge detection Edge linking and boundary detection (2) Local Processing Global Processing (3) Hough Transform Region –based (Similarity) (5) Thresholding (6)Region growing (7) Region splitting and merge 3
  • 4. 4 Image Segmentation Thresholding Light objects in dark background To extract the objects: Select a T that separates the objects from the background i.e. So: (x,y) belongs: To object class if f(x,y)>T To the background if f(x,y)≤T
  • 5. 5 Image Segmentation Thresholding  A more general case of this approach (multilevel thresholding) So: (x,y) belongs: To First object class if T1<f(x,y)≤T2 To the other object if f(x,y)>T2 To the background if f(x,y)≤T1
  • 6. • To partition the image histogram by using a single threshold T. • Then the image is scanned and labels are assigned. • This technique is successful in highly controlled environments. Image Segmentation Simple global Thresholding       T y x f T y x f y x g ) , ( if 0 ) , ( if 1 ) , (
  • 7. 7
  • 8. 8
  • 9. 9 • Based on the histogram of an image • Partition the image histogram using a single global threshold • The success of this technique very strongly depends on how well the histogram can be partitioned Image Segmentation Simple global Thresholding
  • 10. 10 • Imagine a poker playing robot that needs to visually interpret the cards in its hand Original Image Thresholded Image Image Segmentation Simple global Thresholding
  • 11. 11 • If you get the threshold wrong the results can be disastrous Threshold Too Low Threshold Too High Image Segmentation Simple global Thresholding
  • 12. 12 Thresholding Optimal Global and Adaptive Thresholding • This method treats pixel values as probability density functions. • The goal of this method is to minimize the probability of misclassifying pixels as either object or background. • There are two kinds of error: • mislabeling an object pixel as background, and • mislabeling a background pixel as object.
  • 13. 13  Assume the image consists of the objects and background, where the objects occupy P1 of the pixels (P1+P2=1).  Assume both objects and background are subject to a Normal distribution  By the total probability rule, the image is with the following density function:
  • 14. 14  Let T be the threshold. The mis-segmentation takes place in two cases: Background pixels miss-classified into object pixels: the error probability (or the number of errors) is E1 Object pixels miss-classified into background pixels: the error probability (or the number of errors) is E2 The total mis-segmentation error is
  • 15. 15 If the s.d. are the same and P1=P2=1/2: If the s.d. are the same:
  • 16. 16 An algorithm used to obtain T automatically for global thresholding 1. Draw image histogram 2. Compute the average gray level values 1 and 2 for the pixels in regions G1 and G2. 3. Compute a threshold value: T = ½[1 + 2 ] 4. Compute the binary image g(x,y)       T y x f T y x f y x g ) , ( if 0 ) , ( if 1 ) , (
  • 18. 18 • Edges and thresholds sometimes do not give good results for segmentation. • Region-based segmentation is based on the connectivity of similar pixels in a region. • There are two main approaches to region-based segmentation: region growing and region splitting. Image Segmentation Region Based Segmentation
  • 19. 19 Region-Based Segmentation Basic Formulation • Let R represent the entire image region. • Segmentation is a process that partitions R into subregions, R1,R2,…,Rn, such that R Ri n i   1 (a) j i j i R R j i    , and all for (c)  n i Ri ,..., 2 , 1 region, connected a is (b)  n i R P i ,..., 2 , 1 for TRUE ) ( (d)   j i j i R R R R P and regions adjacent any for FALSE ) ( (e)  
  • 20. 20 Region-Based Segmentation Region Growing • Fig. 10.41 shows the histogram of Fig. 10.40 (a). It is difficult to segment the defects by thresholding methods. (Applying region growing methods are better in this case.) Figure 10.41 Figure 10.40(a)
  • 22. 22  Problems: • Starting with a single seed and letting this region grow completely before trying other seeds basis the segmentation in favor of the region which are segmented first • Different choices of seeds may give different segmentation results • Problems can occur if the (arbitrary chosen) seed points lies on an edge Suggested Algorithms and solutions: • No Single region is allowed to completely dominate the proceedings • A number of regions are allowed to grow at the same time Region-Based Segmentation Region Growing
  • 23. 23 Region-Based Segmentation Region Growing Algorithm 1. Start with a set of seed points and from these grows regions by appending to each seed point those neighboring pixel that have similar properties 2. If the absolute difference between the neighbor grey level and the seed pixel's grey level is less than a threshold ,add this pixel to the region, 3. Repeat until all pixels are assigned to regions Designing issues: Seed selection Selection of suitable properties for including points in the various regions (similarity criteria)
  • 25. 25 Region-Based Segmentation Region Splitting and Merging • Region splitting is the opposite of region growing. • First there is a large region (possible the entire image). • Then a predicate (measurement) is used to determine if the region is uniform. • If not, then the method requires that the region be split into two regions. • Then each of these two regions is independently tested by the predicate (measurement). • This procedure continues until all resulting regions are uniform.
  • 26. 26 Region-Based Segmentation Region Splitting • The main problem with region splitting is determining where to split a region. • One method to divide a region is to use a quadtree structure. • Quadtree: a tree in which nodes have exactly four descendants.
  • 27. 27
  • 28. 28 Region-Based Segmentation Region Merging and Splitting Algorithm 1. Start with the whole image as a single suggested region 2. For each region 1. Compute the variance 2. If 1. then split regions into a set of regions consider these regions as suggested regions for the next iteration 2. Else, flag the region as a found region R that will not be split any more Next iteration Repeated steps until all suggested regions are flagged as regions After That There may be more than one region needed to be merged to constitude one region 2 ( ) R T  
  • 29. 29 Start merging as follow: 1. For each neighbor region R1,R2 Check the following conditions 2. Then merge R1and R2 3. Apply this iteratively 1 1 2 2 2 1 2 | ( ) ( )| & ( ) R R S R R T       