Study and
             Implementation of
            Watershed Algorithm
               using MATLAB




Supervisor– Prof. Sanjeev Kumar   By– Mukul Jindal

                                         1
Watershed Algorithm
The watershed transformation is a technique for
segmenting digital images that uses a type of
region growing method based on an image gradient. It
thus effectively combines elements from
both the discontinuity and similarity methods described
below.




                                                      2
What is Image Segmentation
The goal of image segmentation is to reduce the number of colours in the input
reference image and then group neighbouring pixels of similar colour together to
form bounded segments

Segmentation subdivides an image into its constituent regions or groups.

The level to which the subdivision is carried depends on the problem being
solved.

That is, segmentation should stop when the objects of interest in an application
have been isolated.

e.g. automated inspection of electronic assemblies; specific anomalies; missing
components or broken connection paths.



                                                                        3
Image Segmentation
algorithm

It is based on two basic properties of intensity values :

discontinuity and similarity

First Category : Abrupt changes in intensity.

Second Category : Partitioning of regions which are
similar according to a set of predefined criteria. e.g.
thresholding, region growing, region splitting and merging.

                                                          4
First Category is further subdivided
into-




•Points
•Lines
•Edges


                                       5
Detection of discontinuities
Points, lines, edges



The most common way



R = w1*z1 + w2*z2 + ……+ w9*z9




                                6
Point detection


 R  T
 T = Threshold




                  7
Point detection




(b) X-ray image    (c) Result of     (d) Result of point
of a turbine blade point detection   detection mask
with porosity      mask              with threshold
                                                   8
Line detection

– A Suitable Mask in desired direction
– Thresholding




                                         9
Line detection

  • Example:




-45º Mask         Thresholding


                     10
Edge Detection
– Two Mathematical model




                           11
Edge Detection

                      Gray level
                      profile




                   First
                   derivative




           Second derivative




                                   12
Gradient Operators




Y-direction           X-direction




                           13
Diagonal Edge




                  45-Direction
-45-Direction




                         14
Diagonal edge detection




                          15
Things done so far



• Read about different Image Segmentation processes.

• Working my way towards implementing Watershed
algorithm using MATLAB.




                                                       16
Things to be done



• Use preprocessing method to be implemented on
images.

• Implement Watershed Algorithm

• Analyse and record the difference after processing.




                                                        17
Test Result Expected from Watershed
Algorithm




   Test image         After Watershed Algorithm


                                           18
References -


• Paul R. Hill. Wavelet Based Texture Analysis and
Segmentation for Image Retrieval and Fusion. PhD thesis,
University of Bristol, March 2002.

• Richard E. Woods and R.C. Gonzalez. Digital Image
Processing. Pearson Education, 2005.




                                                      19
20

Image segmentation

  • 1.
    Study and Implementation of Watershed Algorithm using MATLAB Supervisor– Prof. Sanjeev Kumar By– Mukul Jindal 1
  • 2.
    Watershed Algorithm The watershedtransformation is a technique for segmenting digital images that uses a type of region growing method based on an image gradient. It thus effectively combines elements from both the discontinuity and similarity methods described below. 2
  • 3.
    What is ImageSegmentation The goal of image segmentation is to reduce the number of colours in the input reference image and then group neighbouring pixels of similar colour together to form bounded segments Segmentation subdivides an image into its constituent regions or groups. The level to which the subdivision is carried depends on the problem being solved. That is, segmentation should stop when the objects of interest in an application have been isolated. e.g. automated inspection of electronic assemblies; specific anomalies; missing components or broken connection paths. 3
  • 4.
    Image Segmentation algorithm It isbased on two basic properties of intensity values : discontinuity and similarity First Category : Abrupt changes in intensity. Second Category : Partitioning of regions which are similar according to a set of predefined criteria. e.g. thresholding, region growing, region splitting and merging. 4
  • 5.
    First Category isfurther subdivided into- •Points •Lines •Edges 5
  • 6.
    Detection of discontinuities Points,lines, edges The most common way R = w1*z1 + w2*z2 + ……+ w9*z9 6
  • 7.
    Point detection R T T = Threshold 7
  • 8.
    Point detection (b) X-rayimage (c) Result of (d) Result of point of a turbine blade point detection detection mask with porosity mask with threshold 8
  • 9.
    Line detection – ASuitable Mask in desired direction – Thresholding 9
  • 10.
    Line detection • Example: -45º Mask Thresholding 10
  • 11.
    Edge Detection – TwoMathematical model 11
  • 12.
    Edge Detection Gray level profile First derivative Second derivative 12
  • 13.
  • 14.
    Diagonal Edge 45-Direction -45-Direction 14
  • 15.
  • 16.
    Things done sofar • Read about different Image Segmentation processes. • Working my way towards implementing Watershed algorithm using MATLAB. 16
  • 17.
    Things to bedone • Use preprocessing method to be implemented on images. • Implement Watershed Algorithm • Analyse and record the difference after processing. 17
  • 18.
    Test Result Expectedfrom Watershed Algorithm Test image After Watershed Algorithm 18
  • 19.
    References - • PaulR. Hill. Wavelet Based Texture Analysis and Segmentation for Image Retrieval and Fusion. PhD thesis, University of Bristol, March 2002. • Richard E. Woods and R.C. Gonzalez. Digital Image Processing. Pearson Education, 2005. 19
  • 20.