SlideShare une entreprise Scribd logo
1  sur  57
COMPUTER GRAPHICS & IMAGE PROCESSING
COM2304
Segmentation Techniques -I
K.A.S.H.Kulathilake
B.Sc. (Hons) IT (SLIIT), MCS (UCSC)
Rajarata University of Sri Lanka
Faculty of Applied Sciences
Department of Physical Sciences
Learning Outcomes
COM 2304 - Computer Graphics & Image
Processing
• At the end of this lecture, you should be
able to;
– define segmentation.
– Describe edge based in segmentation.
– describe thresholding and its properties.
– apply edge detection and thresholding as
segmentation techniques.
2
What is Segmentation?
• Segmentation subdivides an image into its
constituent regions or objects.
• The level of detail to which the subdivision is
carried depends on the problem being solved.
• In other terms, segmentation should stop
when the objects or region of interest (ROI) in
an application have been detected.
COM 2304 - Computer Graphics & Image
Processing
3
What is Segmentation? (Cont…)
COM 2304 - Computer Graphics & Image
Processing
4
What is Segmentation? (Cont…)
• Segmentation accuracy determines the
eventual success or failure of computerized
analysis procedures.
• For this reason, considerable care should be
taken to improve the probability of accurate
segmentation.
COM 2304 - Computer Graphics & Image
Processing
5
What is Segmentation? (Cont…)
• Let R represent the entire spatial region
occupied by an image.
• we may view image segmentation as a process
that partitions R into n sub regions,
R1,R2,R3,……………..Rn, such that;
– Segmentation must be complete; i.e. every pixel
must be in a region.
COM 2304 - Computer Graphics & Image
Processing
6
What is Segmentation? (Cont…)
– Ri is a connected set, i=1,2,…………….,n.
– Ri∩Rj = φ for all i and j, i≠j.
• Regions must be disjoint
– Q(Ri) = TRUE for i=1,2,…….,n.
• Properties that must be satisfied by the pixels in a
segmented regions – ex. Q(Ri) = TRUE if all pixels in Ri
have the same intensity level.
– Q(RiURj) = FALSE for any adjacent regions Ri and
Rj.
• Indicates that two adjacent regions Ri and Rj must be
different in the sense of predicate Q.
COM 2304 - Computer Graphics & Image
Processing
7
Points, Lines and Edge Detection
• The focus of this topic is on segmentation methods that are
based on detecting sharp, local changes in intensity.
• Three types of images features in which we are interested
are;
– Edges: edge pixels are pixels at which the intensity of an image
function changes abruptly, and edges are sets of connected
edge pixels.
– Lines: line may be viewed as a edge segment in which the
intensity of the background on either side of the line is either
much higher or much lower than the intensity of the line pixels.
– Isolated point: It can be viewed as a line whose length and
width are equal to one pixel.
COM 2304 - Computer Graphics & Image
Processing
8
Background of Points, Lines and Edge
Detection
• Local changes in intensity can be detected
using derivatives.
• Derivatives of a digital function are defined in
terms of differences.
• First order derivatives:
– Must be zero in the areas of constant intensity.
– Must be nonzero at the onset of an intensity step or ramp.
– Must be nonzero along the ramp.
COM 2304 - Computer Graphics & Image
Processing
9
Background of Points, Lines and Edge
Detection (Cont…)Image Strip
0
1
2
3
4
5
6
7
8
1st Derivative
-8
-6
-4
-2
0
2
4
6
8
5 5 4 3 2 1 0 0 0 6 0 0 0 0 1 3 1 0 0 0 0 7 7 7 7
-1 -1 -1 -1 -1 0 0 6 -6 0 0 0 1 2 -2 -1 0 0 0 7 0 0 0
10
COM 2304 - Computer Graphics & Image
Processing
Ramp
Isolated point
Line Step
Flat segment
Background of Points, Lines and Edge
Detection (Cont…)
• Second order derivatives:
– Must be zero in the areas of constant intensity.
– Must be nonzero at the onset and end of an intensity
step or ramp.
– Must be zero along the ramp of constant slope.
• First order derivatives provides thick edges and second
order derivatives provides much finer ones (including
noise).
COM 2304 - Computer Graphics & Image
Processing
11
Background of Points, Lines and Edge
Detection (Cont…)
Image Strip
0
1
2
3
4
5
6
7
8
5 5 4 3 2 1 0 0 0 6 0 0 0 0 1 3 1 0 0 0 0 7 7 7 7
2nd Derivative
-15
-10
-5
0
5
10
-1 0 0 0 0 1 0 6 -12 6 0 0 1 1 -4 1 1 0 0 7 -7 0 0
Zero crossing
Zero crossing
property is
quite useful
for locating
edges
12
COM 2304 - Computer Graphics & Image
Processing
Ramp
Isolated point
Line Step
Flat segment
Background of Points, Lines and Edge
Detection (Cont…)
• Double Edge Effect in Second Order Derivatives:
– In both the ramp and step edges that the second
derivatives has opposite signs ( -ve to +ve or vise-
versa) as it transitions into and out of an edge.
– This is known as double edge effect and it is important
to locate edges.
• The sign of the second derivative is used also to
determine whether an edge is a transition from
light to dark (-ve  +ve second derivative) or
from dark to light (+ve  -ve second derivative),
where the sign is observed as we move into the
edge.
COM 2304 - Computer Graphics & Image
Processing
13
Edge Models
• Edge detection is the approach used most
frequently for segmenting images based on
abrupt(local) changes in intensity.
• Edge models are classified according to their
intensity profiles as follows:
– Step edges
– Ramp edges
– Roof edges
COM 2304 - Computer Graphics & Image
Processing
14
Edge Models (Cont…)
• Step Edges:
– A step edge involves a transition between two
intensity levels occurring ideally over the distance
of 1 pixel.
– Canny edge detection algorithm was derived using
a step edge model.
COM 2304 - Computer Graphics & Image
Processing
15
Edge Models (Cont…)
• Ramp Edges:
– In practice, digital images have edges that are blurred and
noisy.
– Blurring determined by limitations in the focusing
mechanism and the noise level determined principally by
the electronic components of the imaging system.
– In such situations, edges are more closely modeled as
having an intensity ramp profile.
– The slope of the ramp is inversely proportional to the
degree of blurring in the edge.
– It does not contains a thin path.
COM 2304 - Computer Graphics & Image
Processing
16
Edge Models (Cont…)
• Roof Edges:
– Roof edge being
determined by the
thickness and
sharpness of the line.
COM 2304 - Computer Graphics & Image
Processing
17
Edge Models (Cont…)
• 1st derivative tells us
where an edge is
• 2nd derivative can
be used to show
edge direction
• Zero crossings can be
used for locating the
canters of thick
edges.
COM 2304 - Computer Graphics & Image
Processing
18
Zero Crossing
Edge Models (Cont…)
• Derivative based edge detectors are extremely sensitive to noise ( 2nd
derivatives are more sensitive).
COM 2304 - Computer Graphics & Image
Processing
19
Images are with Gaussian
Noise
Detection of Isolated Points
• Point detection is based on second
derivatives.
• Point detection can be achieved simply using
the Laplacian mask given below:
• Points are detected at those pixels in the
subsequent filtered image that are above a set
threshold
COM 2304 - Computer Graphics & Image
Processing
20
Detection of Isolated Points (Cont…)
COM 2304 - Computer Graphics & Image
Processing
21
X-ray image of a
turbine blade
Result of point
detection
Result of
thresholding
Line Detection
• We can use Laplacian mask for line detection.
• It is assumed that the lines are thin with respect to
the size of the detector.
• The masks below will extract lines that are one pixel
thick and running in a particular direction.
COM 2304 - Computer Graphics & Image
Processing
22
Line Detection (Cont…)
COM 2304 - Computer Graphics & Image
Processing
23
Binary image of a wire bond mask
Horizontal +45° Verticle -45°
Edge Detection with Image Gradient
• Given a 3*3 region of an image the following edge detection
filters can be used under the 1st order derivatives.
COM 2304 - Computer Graphics & Image
Processing
24
Thresholding
• Objective is to partitioning images directly into regions based
on intensity values and/or properties of these values.
• Single value thresholding can be given mathematically as
follows:
COM 2304 - Computer Graphics & Image
Processing
25






Tyxfif
Tyxfif
yxg
),(0
),(1
),(
T
Histogram
Modes
Thresholding (Cont…)
Original Image Thresholded Image
Thresholding (Cont…)
• If you get the threshold wrong the results can
be disastrous
Threshold Too Low Threshold Too High
The Role of Noise in Image
Thresholding
COM 2304 - Computer Graphics & Image
Processing
28
Original image without
noise
Gaussian noise of 0 mean
and standard deviation of
10 intensity levels
Gaussian noise of 0 mean
and standard deviation of
50 intensity levels
The Role of Illumination &
Reflectance in Image Thresholding
COM 2304 - Computer Graphics & Image
Processing
29
Gaussian noise of 0 mean
and standard deviation of
10 intensity levels
Multiply the noise image with this variable intensity
function to obtain the non-uniformly illuminated
image.
The Role of Illumination &
Reflectance in Image Thresholding
(Cont…)
• Similar results would be obtained when
illumination was uniform and reflectance was not
in situations like natural reflectivity variations in
the surface of object and/ or background.
• The key idea of these experiments is that the
reflectance and the illumination play central role
in the success of image segmentation using
thresholding or other segmentation technique.
• Therefore, controlling these factors should be the
first step considered in the solution of
segmentation problem.
COM 2304 - Computer Graphics & Image
Processing
30
Basic Global Thresholding
• It is possible when the intensity distribution of
objects and background pixels are sufficiently
distinct.
• The basic global threshold, T, is calculated as
follows:
1. Select an initial estimate for T (typically the
average grey level in the image)
2. Segment the image using T to produce two groups
of pixels: G1 consisting of pixels with grey levels >T
and G2 consisting pixels with grey levels ≤ T
3. Compute the average grey levels of pixels in G1 to
give μ1 and G2 to give μ2
COM 2304 - Computer Graphics & Image
Processing
31
Basic Global Thresholding (Cont…)
4. Compute a new threshold value:
5. Repeat steps 2 – 4 until the difference in T in
successive iterations is less than a predefined
limit T∞
COM 2304 - Computer Graphics & Image
Processing
32
2
21  
T
T∞ is used to control the number of iterations in
situations where speed is an important issue. In
general, the larger T∞ is, the fewer iterations the
algorithm will perform.
Basic Global Thresholding (Cont…)
COM 2304 - Computer Graphics & Image
Processing
33
Single value
thresholding only
works for bimodal
histograms
Images with other
kinds of histograms
need more than a
single threshold
This algorithm works very
well for finding thresholds
when the histogram has a
clear valley between the
two modes
Otsu Thresholding
• Otsu's thresholding method involves iterating
through all the possible threshold values and
calculating a measure of spread for the pixel
levels each side of the threshold, i.e. the pixels
that either fall in foreground or background.
• The aim is to find the threshold value where
the sum of foreground and background
spreads is at its minimum.
COM 2304 - Computer Graphics & Image
Processing
34
Otsu Thresholding (Cont…)
• The algorithm will be demonstrated using the simple
6x6 image shown above.
• The calculations for finding the foreground and
background variances (the measure of spread) for a
single threshold are explained next.
• In this case the threshold value is 3.
COM 2304 - Computer Graphics & Image
Processing
35
Otsu Thresholding (Cont…)
COM 2304 - Computer Graphics & Image
Processing
36
Otsu Thresholding (Cont…)
• The next step is to calculate the 'Within-Class
Variance'.
• This is simply the sum of the two variances
multiplied by their associated weights.
• This final value is the 'sum of weighted variances'
for the threshold value 3.
• This same calculation needs to be performed for
all the possible threshold values 0 to 5.
COM 2304 - Computer Graphics & Image
Processing
37
Otsu Thresholding (Cont…)
COM 2304 - Computer Graphics & Image
Processing
38
Otsu Thresholding (Cont…)
• It can be seen that for the threshold equal to 3, as well as being used for
the example, also has the lowest sum of weighted variances.
• Therefore, this is the final selected threshold.
• All pixels with a level less than 3 are background, all those with a level
equal to or greater than 3 are foreground.
• This approach for calculating Otsu's threshold is useful for explaining the
theory, but it is computationally intensive, especially if you have a full 8-bit
greyscale.
COM 2304 - Computer Graphics & Image
Processing
39
Otsu Thresholding (Cont…)
• Making Otsu faster using Between
class variance:
– A faster method of performing the calculations
which is much more appropriate for
implementations.
– So it can also be used for finding the best
threshold and therefore due to being simpler is a
much better approach to use.
COM 2304 - Computer Graphics & Image
Processing
40
Otsu Thresholding (Cont…)
– The table below shows the different variances for
each threshold value.
COM 2304 - Computer Graphics & Image
Processing
41
Otsu Thresholding (Cont…)
COM 2304 - Computer Graphics & Image
Processing
42
Global
Thresholding
T=169
Otsu
Thresholding
T= 181
Effect of Image Smoothing for
Thresholding
COM 2304 - Computer Graphics & Image
Processing
43
Noise image Histogram Otsu Thresholding
Smoothed Image
(5 by 5, Mean)
Histogram Otsu Thresholding
Boundary Distortion occurred
Effect of Image Smoothing for
Thresholding (Cont…)
COM 2304 - Computer Graphics & Image
Processing
44
Noise image Histogram Otsu Thresholding
Smoothed Image
(5 by 5, Mean)
Histogram Otsu Thresholding
Segmentation failed
Effect of Image Smoothing for
Thresholding (Cont…)
• Reason for above matter:
– Region is so small that its contribution to the
histogram is insignificant compared to the
intensity spread caused by noise.
– To overcome this problem from global
thresholding we can use edges.
COM 2304 - Computer Graphics & Image
Processing
45
Using Edges for Improving Global
Thresholding
• We can use pixels that lie on or near the edges
between objects and the background for
improving the shape of the histogram.
• Using pixels that satisfy some simple measures
based on Gradient and Laplacian operators has a
tendency to deepen the valley between
histogram peaks.
• In this approach, we assume that the edges
between the objects and background are known.
COM 2304 - Computer Graphics & Image
Processing
46
Using Edges for Improving Global
Thresholding (Cont…)
• Algorithm: f(x, y) is the input image
1. Compute the edge image ( use either gradient
magnitude or Laplacian method).
2. Specify a threshold value, T.
3. Threshold the image from step 1 using the threshold
from step 2 to produce a binary image, gT(x, y). Use this
image as a mask image to select pixels from f(x, y)
corresponding to “strong” edge pixels.
4. Compute a histogram using only the pixels in f(x, y) that
correspond to the locations of the 1-valued pixels in
gT(x,y).
5. Use the histogram from step 4 to segment f(x, y) globally
using, for example Otsu’s method.
COM 2304 - Computer Graphics & Image
Processing
47
Using Edges for Improving Global
Thresholding (Cont…)
COM 2304 - Computer Graphics & Image
Processing
48
Image of Yeast cells (only white patches ) Histogram Otsu Thresholding
Smoothed Image using Laplacian. T=115 Histogram Otsu Thresholding . Segmentation is
successful
Multiple Thresholds
• Objective of the multiple thresholding is to
separate the original image into multiple
classes.
COM 2304 - Computer Graphics & Image
Processing
49
Dark background
Illuminated area
Shadow
Variable Thresholding
• Image Partitioning
– One of the simplest approach to variable
thresholding is to subdivide an image into non-
overlapping rectangles.
– This approach is used to compensate for non-
uniformities in illumination and/or reflectance.
– The rectangles are chosen small enough to that
the illumination of each is approximately uniform.
COM 2304 - Computer Graphics & Image
Processing
50
Variable Thresholding (Cont…)
COM 2304 - Computer Graphics & Image
Processing
51
Noisy shaded image Histogram Otsu Thresholding
Image sub divide into six sub images Result of applying Otsu method to each sub
image individually
Errors in
segmentation
Variable Thresholding (Cont…)
– Six histograms of six sub images have produced
bimodel histograms as the result of this thresholding
approach.
– Hence, it leads to effective global thresholding.
– Image subdivision generally works well when the
object of interest and the background occupy regions
of reasonably comparable size.
– When this is not the case, the method typically fails
because of the likelihood of subdivisions containing
only object or background pixels.
•
COM 2304 - Computer Graphics & Image
Processing
52
Variable Thresholding (Cont…)
• Adaptive Thresholding:
– It is a modified threshold technique in which the
threshold level is itself variable.
– It is useful when there are strong illumination or
reflectance gradients that you need to threshold
relative to the general intensity gradients.
– Adaptive thresholding set on a pixel by pixel basis
by computing a weighted average of the b-by-b
region around each pixel location minus a
constant where b is given by block size.
COM 2304 - Computer Graphics & Image
Processing
53
Variable Thresholding (Cont…)
COM 2304 - Computer Graphics & Image
Processing
54
Reference
• Chapter 10, of Gonzalez, R.C., Woods, R.E.,
Digital Image Processing, 3rd ed. Addison-
Wesley Pub.
• Threshold, Learning OpenCV, pp 135-141
• Lecture 07
• http://www.labbookpages.co.uk/software/im
gProc/otsuThreshold.html
COM 2304 - Computer Graphics & Image
Processing
55
Learning Outcomes Revisit
• Now, you should be able to;
– define segmentation.
– Describe edge based in segmentation.
– describe thresholding and its properties.
– apply edge detection and thresholding as
segmentation techniques.
COM 2304 - Computer Graphics & Image
Processing
56
QUESTIONS ?
Next Lecture – Segmentation Techniques - II
COM 2304 - Computer Graphics & Image
Processing
57

Contenu connexe

Tendances

Digital image processing img smoothning
Digital image processing img smoothningDigital image processing img smoothning
Digital image processing img smoothningVinay Gupta
 
Chapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woodsChapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woodsasodariyabhavesh
 
digital image processing, image processing
digital image processing, image processingdigital image processing, image processing
digital image processing, image processingKalyan Acharjya
 
Image Restoration
Image RestorationImage Restoration
Image RestorationPoonam Seth
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and SegmentationA B Shinde
 
04 image enhancement edge detection
04 image enhancement edge detection04 image enhancement edge detection
04 image enhancement edge detectionRumah Belajar
 
Image segmentation ppt
Image segmentation pptImage segmentation ppt
Image segmentation pptGichelle Amon
 
Introduction to digital image processing
Introduction to digital image processingIntroduction to digital image processing
Introduction to digital image processingHossain Md Shakhawat
 
Color Image Processing: Basics
Color Image Processing: BasicsColor Image Processing: Basics
Color Image Processing: BasicsA B Shinde
 
Image processing fundamentals
Image processing fundamentalsImage processing fundamentals
Image processing fundamentalsA B Shinde
 
Digital Image Processing - Image Enhancement
Digital Image Processing  - Image EnhancementDigital Image Processing  - Image Enhancement
Digital Image Processing - Image EnhancementMathankumar S
 
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 restoration and enhancement #2
Image restoration and enhancement #2 Image restoration and enhancement #2
Image restoration and enhancement #2 Gera Paulos
 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processingAhmed Daoud
 
Image enhancement in the spatial domain1
Image enhancement in the spatial domain1Image enhancement in the spatial domain1
Image enhancement in the spatial domain1shabanam tamboli
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit NotesAAKANKSHA JAIN
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processingAbinaya B
 

Tendances (20)

Digital image processing img smoothning
Digital image processing img smoothningDigital image processing img smoothning
Digital image processing img smoothning
 
Chapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woodsChapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woods
 
digital image processing, image processing
digital image processing, image processingdigital image processing, image processing
digital image processing, image processing
 
Image Restoration
Image RestorationImage Restoration
Image Restoration
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
Segmentation
SegmentationSegmentation
Segmentation
 
04 image enhancement edge detection
04 image enhancement edge detection04 image enhancement edge detection
04 image enhancement edge detection
 
Image segmentation ppt
Image segmentation pptImage segmentation ppt
Image segmentation ppt
 
Introduction to digital image processing
Introduction to digital image processingIntroduction to digital image processing
Introduction to digital image processing
 
Color Image Processing: Basics
Color Image Processing: BasicsColor Image Processing: Basics
Color Image Processing: Basics
 
Image processing fundamentals
Image processing fundamentalsImage processing fundamentals
Image processing fundamentals
 
Digital Image Processing - Image Enhancement
Digital Image Processing  - Image EnhancementDigital Image Processing  - Image Enhancement
Digital Image Processing - Image Enhancement
 
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 restoration and enhancement #2
Image restoration and enhancement #2 Image restoration and enhancement #2
Image restoration and enhancement #2
 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processing
 
Cse image processing ppt
Cse image processing pptCse image processing ppt
Cse image processing ppt
 
Image enhancement in the spatial domain1
Image enhancement in the spatial domain1Image enhancement in the spatial domain1
Image enhancement in the spatial domain1
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit Notes
 
Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processing
 

Similaire à Segmentation Techniques -I

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
 
COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...
COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...
COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...Hemantha Kulathilake
 
COM2304: Introduction to Computer Vision & Image Processing
COM2304: Introduction to Computer Vision & Image Processing COM2304: Introduction to Computer Vision & Image Processing
COM2304: Introduction to Computer Vision & Image Processing Hemantha Kulathilake
 
Module-5-1_230523_171754 (1).pdf
Module-5-1_230523_171754 (1).pdfModule-5-1_230523_171754 (1).pdf
Module-5-1_230523_171754 (1).pdfvikasmittal92
 
COM2304: Morphological Image Processing
COM2304: Morphological Image ProcessingCOM2304: Morphological Image Processing
COM2304: Morphological Image ProcessingHemantha Kulathilake
 
COM2304: Digital Image Fundamentals - I
COM2304: Digital Image Fundamentals - I COM2304: Digital Image Fundamentals - I
COM2304: Digital Image Fundamentals - I Hemantha Kulathilake
 
image segmentation by ppres.pptx
image segmentation by ppres.pptximage segmentation by ppres.pptx
image segmentation by ppres.pptxmohan134666
 
Module-V 096.pdf
Module-V 096.pdfModule-V 096.pdf
Module-V 096.pdfSamrajECE
 
09 cie552 image_featuresi
09 cie552 image_featuresi09 cie552 image_featuresi
09 cie552 image_featuresiElsayed Hemayed
 
YCIS_Forensic_Image Enhancement and Edge detection.pptx
YCIS_Forensic_Image Enhancement and Edge detection.pptxYCIS_Forensic_Image Enhancement and Edge detection.pptx
YCIS_Forensic_Image Enhancement and Edge detection.pptxSharmilaMore5
 
Final Thesis Presentation Licenseplaterecognitionincomplexscenes
Final Thesis Presentation LicenseplaterecognitionincomplexscenesFinal Thesis Presentation Licenseplaterecognitionincomplexscenes
Final Thesis Presentation Licenseplaterecognitionincomplexscenesdswazalwar
 
Spatial Filtering in intro image processingr
Spatial Filtering in intro image processingrSpatial Filtering in intro image processingr
Spatial Filtering in intro image processingrkumarankit06875
 
Defect detection in circlips using image processing in ni lab view
Defect detection in circlips using image processing in ni lab viewDefect detection in circlips using image processing in ni lab view
Defect detection in circlips using image processing in ni lab viewSayali Bodhankar
 
Vision system for robotics and servo controller
Vision system for robotics and servo controllerVision system for robotics and servo controller
Vision system for robotics and servo controllerGowsick Subramaniam
 
Object detection at night
Object detection at nightObject detection at night
Object detection at nightSanjay Crúzé
 

Similaire à Segmentation Techniques -I (20)

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...
 
COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...
COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...
COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...
 
Digital Image Fundamentals - II
Digital Image Fundamentals - IIDigital Image Fundamentals - II
Digital Image Fundamentals - II
 
PPT s06-machine vision-s2
PPT s06-machine vision-s2PPT s06-machine vision-s2
PPT s06-machine vision-s2
 
COM2304: Introduction to Computer Vision & Image Processing
COM2304: Introduction to Computer Vision & Image Processing COM2304: Introduction to Computer Vision & Image Processing
COM2304: Introduction to Computer Vision & Image Processing
 
Segmentation Techniques -II
Segmentation Techniques -IISegmentation Techniques -II
Segmentation Techniques -II
 
Module-5-1_230523_171754 (1).pdf
Module-5-1_230523_171754 (1).pdfModule-5-1_230523_171754 (1).pdf
Module-5-1_230523_171754 (1).pdf
 
COM2304: Morphological Image Processing
COM2304: Morphological Image ProcessingCOM2304: Morphological Image Processing
COM2304: Morphological Image Processing
 
COM2304: Digital Image Fundamentals - I
COM2304: Digital Image Fundamentals - I COM2304: Digital Image Fundamentals - I
COM2304: Digital Image Fundamentals - I
 
image segmentation by ppres.pptx
image segmentation by ppres.pptximage segmentation by ppres.pptx
image segmentation by ppres.pptx
 
Module-V 096.pdf
Module-V 096.pdfModule-V 096.pdf
Module-V 096.pdf
 
ACMP340.pptx
ACMP340.pptxACMP340.pptx
ACMP340.pptx
 
09 cie552 image_featuresi
09 cie552 image_featuresi09 cie552 image_featuresi
09 cie552 image_featuresi
 
YCIS_Forensic_Image Enhancement and Edge detection.pptx
YCIS_Forensic_Image Enhancement and Edge detection.pptxYCIS_Forensic_Image Enhancement and Edge detection.pptx
YCIS_Forensic_Image Enhancement and Edge detection.pptx
 
Final Thesis Presentation Licenseplaterecognitionincomplexscenes
Final Thesis Presentation LicenseplaterecognitionincomplexscenesFinal Thesis Presentation Licenseplaterecognitionincomplexscenes
Final Thesis Presentation Licenseplaterecognitionincomplexscenes
 
Spatial Filtering in intro image processingr
Spatial Filtering in intro image processingrSpatial Filtering in intro image processingr
Spatial Filtering in intro image processingr
 
thesis
thesisthesis
thesis
 
Defect detection in circlips using image processing in ni lab view
Defect detection in circlips using image processing in ni lab viewDefect detection in circlips using image processing in ni lab view
Defect detection in circlips using image processing in ni lab view
 
Vision system for robotics and servo controller
Vision system for robotics and servo controllerVision system for robotics and servo controller
Vision system for robotics and servo controller
 
Object detection at night
Object detection at nightObject detection at night
Object detection at night
 

Plus de Hemantha Kulathilake

NLP_KASHK:Parsing with Context-Free Grammar
NLP_KASHK:Parsing with Context-Free Grammar NLP_KASHK:Parsing with Context-Free Grammar
NLP_KASHK:Parsing with Context-Free Grammar Hemantha Kulathilake
 
NLP_KASHK:Context-Free Grammar for English
NLP_KASHK:Context-Free Grammar for EnglishNLP_KASHK:Context-Free Grammar for English
NLP_KASHK:Context-Free Grammar for EnglishHemantha Kulathilake
 
NLP_KASHK:Evaluating Language Model
NLP_KASHK:Evaluating Language ModelNLP_KASHK:Evaluating Language Model
NLP_KASHK:Evaluating Language ModelHemantha Kulathilake
 
NLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological ParsingNLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological ParsingHemantha Kulathilake
 
COM1407: Structures, Unions & Dynamic Memory Allocation
COM1407: Structures, Unions & Dynamic Memory Allocation COM1407: Structures, Unions & Dynamic Memory Allocation
COM1407: Structures, Unions & Dynamic Memory Allocation Hemantha Kulathilake
 

Plus de Hemantha Kulathilake (20)

NLP_KASHK:Parsing with Context-Free Grammar
NLP_KASHK:Parsing with Context-Free Grammar NLP_KASHK:Parsing with Context-Free Grammar
NLP_KASHK:Parsing with Context-Free Grammar
 
NLP_KASHK:Context-Free Grammar for English
NLP_KASHK:Context-Free Grammar for EnglishNLP_KASHK:Context-Free Grammar for English
NLP_KASHK:Context-Free Grammar for English
 
NLP_KASHK:POS Tagging
NLP_KASHK:POS TaggingNLP_KASHK:POS Tagging
NLP_KASHK:POS Tagging
 
NLP_KASHK:Markov Models
NLP_KASHK:Markov ModelsNLP_KASHK:Markov Models
NLP_KASHK:Markov Models
 
NLP_KASHK:Smoothing N-gram Models
NLP_KASHK:Smoothing N-gram ModelsNLP_KASHK:Smoothing N-gram Models
NLP_KASHK:Smoothing N-gram Models
 
NLP_KASHK:Evaluating Language Model
NLP_KASHK:Evaluating Language ModelNLP_KASHK:Evaluating Language Model
NLP_KASHK:Evaluating Language Model
 
NLP_KASHK:N-Grams
NLP_KASHK:N-GramsNLP_KASHK:N-Grams
NLP_KASHK:N-Grams
 
NLP_KASHK:Minimum Edit Distance
NLP_KASHK:Minimum Edit DistanceNLP_KASHK:Minimum Edit Distance
NLP_KASHK:Minimum Edit Distance
 
NLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological ParsingNLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological Parsing
 
NLP_KASHK:Morphology
NLP_KASHK:MorphologyNLP_KASHK:Morphology
NLP_KASHK:Morphology
 
NLP_KASHK:Text Normalization
NLP_KASHK:Text NormalizationNLP_KASHK:Text Normalization
NLP_KASHK:Text Normalization
 
NLP_KASHK:Finite-State Automata
NLP_KASHK:Finite-State AutomataNLP_KASHK:Finite-State Automata
NLP_KASHK:Finite-State Automata
 
NLP_KASHK:Regular Expressions
NLP_KASHK:Regular Expressions NLP_KASHK:Regular Expressions
NLP_KASHK:Regular Expressions
 
NLP_KASHK: Introduction
NLP_KASHK: Introduction NLP_KASHK: Introduction
NLP_KASHK: Introduction
 
COM1407: File Processing
COM1407: File Processing COM1407: File Processing
COM1407: File Processing
 
COm1407: Character & Strings
COm1407: Character & StringsCOm1407: Character & Strings
COm1407: Character & Strings
 
COM1407: Structures, Unions & Dynamic Memory Allocation
COM1407: Structures, Unions & Dynamic Memory Allocation COM1407: Structures, Unions & Dynamic Memory Allocation
COM1407: Structures, Unions & Dynamic Memory Allocation
 
COM1407: Input/ Output Functions
COM1407: Input/ Output FunctionsCOM1407: Input/ Output Functions
COM1407: Input/ Output Functions
 
COM1407: Working with Pointers
COM1407: Working with PointersCOM1407: Working with Pointers
COM1407: Working with Pointers
 
COM1407: Arrays
COM1407: ArraysCOM1407: Arrays
COM1407: Arrays
 

Dernier

Chromatin Structure | EUCHROMATIN | HETEROCHROMATIN
Chromatin Structure | EUCHROMATIN | HETEROCHROMATINChromatin Structure | EUCHROMATIN | HETEROCHROMATIN
Chromatin Structure | EUCHROMATIN | HETEROCHROMATINsankalpkumarsahoo174
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )aarthirajkumar25
 
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
 
Chemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfChemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfSumit Kumar yadav
 
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPirithiRaju
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTSérgio Sacani
 
Recombinant DNA technology (Immunological screening)
Recombinant DNA technology (Immunological screening)Recombinant DNA technology (Immunological screening)
Recombinant DNA technology (Immunological screening)PraveenaKalaiselvan1
 
Botany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdfBotany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdfSumit Kumar yadav
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​kaibalyasahoo82800
 
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticsPulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticssakshisoni2385
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksSérgio Sacani
 
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...ssifa0344
 
Biological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdfBiological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdfmuntazimhurra
 
Physiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptxPhysiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptxAArockiyaNisha
 
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...Sérgio Sacani
 
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls AgencyHire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls AgencySheetal Arora
 
Natural Polymer Based Nanomaterials
Natural Polymer Based NanomaterialsNatural Polymer Based Nanomaterials
Natural Polymer Based NanomaterialsAArockiyaNisha
 
VIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C PVIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C PPRINCE C P
 
Forensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfForensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfrohankumarsinghrore1
 
DIFFERENCE IN BACK CROSS AND TEST CROSS
DIFFERENCE IN  BACK CROSS AND TEST CROSSDIFFERENCE IN  BACK CROSS AND TEST CROSS
DIFFERENCE IN BACK CROSS AND TEST CROSSLeenakshiTyagi
 

Dernier (20)

Chromatin Structure | EUCHROMATIN | HETEROCHROMATIN
Chromatin Structure | EUCHROMATIN | HETEROCHROMATINChromatin Structure | EUCHROMATIN | HETEROCHROMATIN
Chromatin Structure | EUCHROMATIN | HETEROCHROMATIN
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )
 
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...
 
Chemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfChemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdf
 
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOST
 
Recombinant DNA technology (Immunological screening)
Recombinant DNA technology (Immunological screening)Recombinant DNA technology (Immunological screening)
Recombinant DNA technology (Immunological screening)
 
Botany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdfBotany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdf
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​
 
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticsPulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
 
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
 
Biological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdfBiological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdf
 
Physiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptxPhysiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptx
 
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
 
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls AgencyHire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
 
Natural Polymer Based Nanomaterials
Natural Polymer Based NanomaterialsNatural Polymer Based Nanomaterials
Natural Polymer Based Nanomaterials
 
VIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C PVIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C P
 
Forensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfForensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdf
 
DIFFERENCE IN BACK CROSS AND TEST CROSS
DIFFERENCE IN  BACK CROSS AND TEST CROSSDIFFERENCE IN  BACK CROSS AND TEST CROSS
DIFFERENCE IN BACK CROSS AND TEST CROSS
 

Segmentation Techniques -I

  • 1. COMPUTER GRAPHICS & IMAGE PROCESSING COM2304 Segmentation Techniques -I K.A.S.H.Kulathilake B.Sc. (Hons) IT (SLIIT), MCS (UCSC) Rajarata University of Sri Lanka Faculty of Applied Sciences Department of Physical Sciences
  • 2. Learning Outcomes COM 2304 - Computer Graphics & Image Processing • At the end of this lecture, you should be able to; – define segmentation. – Describe edge based in segmentation. – describe thresholding and its properties. – apply edge detection and thresholding as segmentation techniques. 2
  • 3. What is Segmentation? • Segmentation subdivides an image into its constituent regions or objects. • The level of detail to which the subdivision is carried depends on the problem being solved. • In other terms, segmentation should stop when the objects or region of interest (ROI) in an application have been detected. COM 2304 - Computer Graphics & Image Processing 3
  • 4. What is Segmentation? (Cont…) COM 2304 - Computer Graphics & Image Processing 4
  • 5. What is Segmentation? (Cont…) • Segmentation accuracy determines the eventual success or failure of computerized analysis procedures. • For this reason, considerable care should be taken to improve the probability of accurate segmentation. COM 2304 - Computer Graphics & Image Processing 5
  • 6. What is Segmentation? (Cont…) • Let R represent the entire spatial region occupied by an image. • we may view image segmentation as a process that partitions R into n sub regions, R1,R2,R3,……………..Rn, such that; – Segmentation must be complete; i.e. every pixel must be in a region. COM 2304 - Computer Graphics & Image Processing 6
  • 7. What is Segmentation? (Cont…) – Ri is a connected set, i=1,2,…………….,n. – Ri∩Rj = φ for all i and j, i≠j. • Regions must be disjoint – Q(Ri) = TRUE for i=1,2,…….,n. • Properties that must be satisfied by the pixels in a segmented regions – ex. Q(Ri) = TRUE if all pixels in Ri have the same intensity level. – Q(RiURj) = FALSE for any adjacent regions Ri and Rj. • Indicates that two adjacent regions Ri and Rj must be different in the sense of predicate Q. COM 2304 - Computer Graphics & Image Processing 7
  • 8. Points, Lines and Edge Detection • The focus of this topic is on segmentation methods that are based on detecting sharp, local changes in intensity. • Three types of images features in which we are interested are; – Edges: edge pixels are pixels at which the intensity of an image function changes abruptly, and edges are sets of connected edge pixels. – Lines: line may be viewed as a edge segment in which the intensity of the background on either side of the line is either much higher or much lower than the intensity of the line pixels. – Isolated point: It can be viewed as a line whose length and width are equal to one pixel. COM 2304 - Computer Graphics & Image Processing 8
  • 9. Background of Points, Lines and Edge Detection • Local changes in intensity can be detected using derivatives. • Derivatives of a digital function are defined in terms of differences. • First order derivatives: – Must be zero in the areas of constant intensity. – Must be nonzero at the onset of an intensity step or ramp. – Must be nonzero along the ramp. COM 2304 - Computer Graphics & Image Processing 9
  • 10. Background of Points, Lines and Edge Detection (Cont…)Image Strip 0 1 2 3 4 5 6 7 8 1st Derivative -8 -6 -4 -2 0 2 4 6 8 5 5 4 3 2 1 0 0 0 6 0 0 0 0 1 3 1 0 0 0 0 7 7 7 7 -1 -1 -1 -1 -1 0 0 6 -6 0 0 0 1 2 -2 -1 0 0 0 7 0 0 0 10 COM 2304 - Computer Graphics & Image Processing Ramp Isolated point Line Step Flat segment
  • 11. Background of Points, Lines and Edge Detection (Cont…) • Second order derivatives: – Must be zero in the areas of constant intensity. – Must be nonzero at the onset and end of an intensity step or ramp. – Must be zero along the ramp of constant slope. • First order derivatives provides thick edges and second order derivatives provides much finer ones (including noise). COM 2304 - Computer Graphics & Image Processing 11
  • 12. Background of Points, Lines and Edge Detection (Cont…) Image Strip 0 1 2 3 4 5 6 7 8 5 5 4 3 2 1 0 0 0 6 0 0 0 0 1 3 1 0 0 0 0 7 7 7 7 2nd Derivative -15 -10 -5 0 5 10 -1 0 0 0 0 1 0 6 -12 6 0 0 1 1 -4 1 1 0 0 7 -7 0 0 Zero crossing Zero crossing property is quite useful for locating edges 12 COM 2304 - Computer Graphics & Image Processing Ramp Isolated point Line Step Flat segment
  • 13. Background of Points, Lines and Edge Detection (Cont…) • Double Edge Effect in Second Order Derivatives: – In both the ramp and step edges that the second derivatives has opposite signs ( -ve to +ve or vise- versa) as it transitions into and out of an edge. – This is known as double edge effect and it is important to locate edges. • The sign of the second derivative is used also to determine whether an edge is a transition from light to dark (-ve  +ve second derivative) or from dark to light (+ve  -ve second derivative), where the sign is observed as we move into the edge. COM 2304 - Computer Graphics & Image Processing 13
  • 14. Edge Models • Edge detection is the approach used most frequently for segmenting images based on abrupt(local) changes in intensity. • Edge models are classified according to their intensity profiles as follows: – Step edges – Ramp edges – Roof edges COM 2304 - Computer Graphics & Image Processing 14
  • 15. Edge Models (Cont…) • Step Edges: – A step edge involves a transition between two intensity levels occurring ideally over the distance of 1 pixel. – Canny edge detection algorithm was derived using a step edge model. COM 2304 - Computer Graphics & Image Processing 15
  • 16. Edge Models (Cont…) • Ramp Edges: – In practice, digital images have edges that are blurred and noisy. – Blurring determined by limitations in the focusing mechanism and the noise level determined principally by the electronic components of the imaging system. – In such situations, edges are more closely modeled as having an intensity ramp profile. – The slope of the ramp is inversely proportional to the degree of blurring in the edge. – It does not contains a thin path. COM 2304 - Computer Graphics & Image Processing 16
  • 17. Edge Models (Cont…) • Roof Edges: – Roof edge being determined by the thickness and sharpness of the line. COM 2304 - Computer Graphics & Image Processing 17
  • 18. Edge Models (Cont…) • 1st derivative tells us where an edge is • 2nd derivative can be used to show edge direction • Zero crossings can be used for locating the canters of thick edges. COM 2304 - Computer Graphics & Image Processing 18 Zero Crossing
  • 19. Edge Models (Cont…) • Derivative based edge detectors are extremely sensitive to noise ( 2nd derivatives are more sensitive). COM 2304 - Computer Graphics & Image Processing 19 Images are with Gaussian Noise
  • 20. Detection of Isolated Points • Point detection is based on second derivatives. • Point detection can be achieved simply using the Laplacian mask given below: • Points are detected at those pixels in the subsequent filtered image that are above a set threshold COM 2304 - Computer Graphics & Image Processing 20
  • 21. Detection of Isolated Points (Cont…) COM 2304 - Computer Graphics & Image Processing 21 X-ray image of a turbine blade Result of point detection Result of thresholding
  • 22. Line Detection • We can use Laplacian mask for line detection. • It is assumed that the lines are thin with respect to the size of the detector. • The masks below will extract lines that are one pixel thick and running in a particular direction. COM 2304 - Computer Graphics & Image Processing 22
  • 23. Line Detection (Cont…) COM 2304 - Computer Graphics & Image Processing 23 Binary image of a wire bond mask Horizontal +45° Verticle -45°
  • 24. Edge Detection with Image Gradient • Given a 3*3 region of an image the following edge detection filters can be used under the 1st order derivatives. COM 2304 - Computer Graphics & Image Processing 24
  • 25. Thresholding • Objective is to partitioning images directly into regions based on intensity values and/or properties of these values. • Single value thresholding can be given mathematically as follows: COM 2304 - Computer Graphics & Image Processing 25       Tyxfif Tyxfif yxg ),(0 ),(1 ),( T Histogram Modes
  • 27. Thresholding (Cont…) • If you get the threshold wrong the results can be disastrous Threshold Too Low Threshold Too High
  • 28. The Role of Noise in Image Thresholding COM 2304 - Computer Graphics & Image Processing 28 Original image without noise Gaussian noise of 0 mean and standard deviation of 10 intensity levels Gaussian noise of 0 mean and standard deviation of 50 intensity levels
  • 29. The Role of Illumination & Reflectance in Image Thresholding COM 2304 - Computer Graphics & Image Processing 29 Gaussian noise of 0 mean and standard deviation of 10 intensity levels Multiply the noise image with this variable intensity function to obtain the non-uniformly illuminated image.
  • 30. The Role of Illumination & Reflectance in Image Thresholding (Cont…) • Similar results would be obtained when illumination was uniform and reflectance was not in situations like natural reflectivity variations in the surface of object and/ or background. • The key idea of these experiments is that the reflectance and the illumination play central role in the success of image segmentation using thresholding or other segmentation technique. • Therefore, controlling these factors should be the first step considered in the solution of segmentation problem. COM 2304 - Computer Graphics & Image Processing 30
  • 31. Basic Global Thresholding • It is possible when the intensity distribution of objects and background pixels are sufficiently distinct. • The basic global threshold, T, is calculated as follows: 1. Select an initial estimate for T (typically the average grey level in the image) 2. Segment the image using T to produce two groups of pixels: G1 consisting of pixels with grey levels >T and G2 consisting pixels with grey levels ≤ T 3. Compute the average grey levels of pixels in G1 to give μ1 and G2 to give μ2 COM 2304 - Computer Graphics & Image Processing 31
  • 32. Basic Global Thresholding (Cont…) 4. Compute a new threshold value: 5. Repeat steps 2 – 4 until the difference in T in successive iterations is less than a predefined limit T∞ COM 2304 - Computer Graphics & Image Processing 32 2 21   T T∞ is used to control the number of iterations in situations where speed is an important issue. In general, the larger T∞ is, the fewer iterations the algorithm will perform.
  • 33. Basic Global Thresholding (Cont…) COM 2304 - Computer Graphics & Image Processing 33 Single value thresholding only works for bimodal histograms Images with other kinds of histograms need more than a single threshold This algorithm works very well for finding thresholds when the histogram has a clear valley between the two modes
  • 34. Otsu Thresholding • Otsu's thresholding method involves iterating through all the possible threshold values and calculating a measure of spread for the pixel levels each side of the threshold, i.e. the pixels that either fall in foreground or background. • The aim is to find the threshold value where the sum of foreground and background spreads is at its minimum. COM 2304 - Computer Graphics & Image Processing 34
  • 35. Otsu Thresholding (Cont…) • The algorithm will be demonstrated using the simple 6x6 image shown above. • The calculations for finding the foreground and background variances (the measure of spread) for a single threshold are explained next. • In this case the threshold value is 3. COM 2304 - Computer Graphics & Image Processing 35
  • 36. Otsu Thresholding (Cont…) COM 2304 - Computer Graphics & Image Processing 36
  • 37. Otsu Thresholding (Cont…) • The next step is to calculate the 'Within-Class Variance'. • This is simply the sum of the two variances multiplied by their associated weights. • This final value is the 'sum of weighted variances' for the threshold value 3. • This same calculation needs to be performed for all the possible threshold values 0 to 5. COM 2304 - Computer Graphics & Image Processing 37
  • 38. Otsu Thresholding (Cont…) COM 2304 - Computer Graphics & Image Processing 38
  • 39. Otsu Thresholding (Cont…) • It can be seen that for the threshold equal to 3, as well as being used for the example, also has the lowest sum of weighted variances. • Therefore, this is the final selected threshold. • All pixels with a level less than 3 are background, all those with a level equal to or greater than 3 are foreground. • This approach for calculating Otsu's threshold is useful for explaining the theory, but it is computationally intensive, especially if you have a full 8-bit greyscale. COM 2304 - Computer Graphics & Image Processing 39
  • 40. Otsu Thresholding (Cont…) • Making Otsu faster using Between class variance: – A faster method of performing the calculations which is much more appropriate for implementations. – So it can also be used for finding the best threshold and therefore due to being simpler is a much better approach to use. COM 2304 - Computer Graphics & Image Processing 40
  • 41. Otsu Thresholding (Cont…) – The table below shows the different variances for each threshold value. COM 2304 - Computer Graphics & Image Processing 41
  • 42. Otsu Thresholding (Cont…) COM 2304 - Computer Graphics & Image Processing 42 Global Thresholding T=169 Otsu Thresholding T= 181
  • 43. Effect of Image Smoothing for Thresholding COM 2304 - Computer Graphics & Image Processing 43 Noise image Histogram Otsu Thresholding Smoothed Image (5 by 5, Mean) Histogram Otsu Thresholding Boundary Distortion occurred
  • 44. Effect of Image Smoothing for Thresholding (Cont…) COM 2304 - Computer Graphics & Image Processing 44 Noise image Histogram Otsu Thresholding Smoothed Image (5 by 5, Mean) Histogram Otsu Thresholding Segmentation failed
  • 45. Effect of Image Smoothing for Thresholding (Cont…) • Reason for above matter: – Region is so small that its contribution to the histogram is insignificant compared to the intensity spread caused by noise. – To overcome this problem from global thresholding we can use edges. COM 2304 - Computer Graphics & Image Processing 45
  • 46. Using Edges for Improving Global Thresholding • We can use pixels that lie on or near the edges between objects and the background for improving the shape of the histogram. • Using pixels that satisfy some simple measures based on Gradient and Laplacian operators has a tendency to deepen the valley between histogram peaks. • In this approach, we assume that the edges between the objects and background are known. COM 2304 - Computer Graphics & Image Processing 46
  • 47. Using Edges for Improving Global Thresholding (Cont…) • Algorithm: f(x, y) is the input image 1. Compute the edge image ( use either gradient magnitude or Laplacian method). 2. Specify a threshold value, T. 3. Threshold the image from step 1 using the threshold from step 2 to produce a binary image, gT(x, y). Use this image as a mask image to select pixels from f(x, y) corresponding to “strong” edge pixels. 4. Compute a histogram using only the pixels in f(x, y) that correspond to the locations of the 1-valued pixels in gT(x,y). 5. Use the histogram from step 4 to segment f(x, y) globally using, for example Otsu’s method. COM 2304 - Computer Graphics & Image Processing 47
  • 48. Using Edges for Improving Global Thresholding (Cont…) COM 2304 - Computer Graphics & Image Processing 48 Image of Yeast cells (only white patches ) Histogram Otsu Thresholding Smoothed Image using Laplacian. T=115 Histogram Otsu Thresholding . Segmentation is successful
  • 49. Multiple Thresholds • Objective of the multiple thresholding is to separate the original image into multiple classes. COM 2304 - Computer Graphics & Image Processing 49 Dark background Illuminated area Shadow
  • 50. Variable Thresholding • Image Partitioning – One of the simplest approach to variable thresholding is to subdivide an image into non- overlapping rectangles. – This approach is used to compensate for non- uniformities in illumination and/or reflectance. – The rectangles are chosen small enough to that the illumination of each is approximately uniform. COM 2304 - Computer Graphics & Image Processing 50
  • 51. Variable Thresholding (Cont…) COM 2304 - Computer Graphics & Image Processing 51 Noisy shaded image Histogram Otsu Thresholding Image sub divide into six sub images Result of applying Otsu method to each sub image individually Errors in segmentation
  • 52. Variable Thresholding (Cont…) – Six histograms of six sub images have produced bimodel histograms as the result of this thresholding approach. – Hence, it leads to effective global thresholding. – Image subdivision generally works well when the object of interest and the background occupy regions of reasonably comparable size. – When this is not the case, the method typically fails because of the likelihood of subdivisions containing only object or background pixels. • COM 2304 - Computer Graphics & Image Processing 52
  • 53. Variable Thresholding (Cont…) • Adaptive Thresholding: – It is a modified threshold technique in which the threshold level is itself variable. – It is useful when there are strong illumination or reflectance gradients that you need to threshold relative to the general intensity gradients. – Adaptive thresholding set on a pixel by pixel basis by computing a weighted average of the b-by-b region around each pixel location minus a constant where b is given by block size. COM 2304 - Computer Graphics & Image Processing 53
  • 54. Variable Thresholding (Cont…) COM 2304 - Computer Graphics & Image Processing 54
  • 55. Reference • Chapter 10, of Gonzalez, R.C., Woods, R.E., Digital Image Processing, 3rd ed. Addison- Wesley Pub. • Threshold, Learning OpenCV, pp 135-141 • Lecture 07 • http://www.labbookpages.co.uk/software/im gProc/otsuThreshold.html COM 2304 - Computer Graphics & Image Processing 55
  • 56. Learning Outcomes Revisit • Now, you should be able to; – define segmentation. – Describe edge based in segmentation. – describe thresholding and its properties. – apply edge detection and thresholding as segmentation techniques. COM 2304 - Computer Graphics & Image Processing 56
  • 57. QUESTIONS ? Next Lecture – Segmentation Techniques - II COM 2304 - Computer Graphics & Image Processing 57