You are on page 1of 8

Unit-IV Image Segmentation Segmentation subdivides an image into its constituent regions or objects.

Edge detection: Edge detection is the approach used for segmenting images based on abrupt changes in intensity. Finding edges can be accomplished using first or second order derivatives.

Filter masks used to compute the derivatives are called gradient operators or edge detectors

Prewitt operator -1 -1 -1 0 0 0 1 1 1

-1 0 1

-1 0 1

-1 0 1

Sobel operator

-1 0 1

-2 0 2

-1 0 1

-1 -2 -1

0 0 0

1 2 1

Prewitt and Sobel masks for detecting diagonal edges -1 -1 0 -1 0 1 0 1 1

0 -1 -1

1 0 -1

1 1 0

0 -1 -2

1 0 -1

2 1 0

-2 -1 0

-1 0 1

0 1 2

The masks are used to obtain the gradient components gx and gy at every pixel location in an image.

Marr-Hildreth edge detector( laplacian of Gaussian LoG) uses the mask

0 0 -1 0 0

0 -1 -2 -1 0

-1 -2 16 -2 -1

0 -1 -2 -1 0

0 0 -1 0 0

Edge Linking via Hough transforms

Consider a point (x i, y i) in the xy plane. Eqn of straight line in slope intercept form y i= x i
+

b
+

Many lines passing through (x i, y i) they all satisfy the equation y i= x i for varying values of a and b.

Obtain the normal representation of a line x cos + y sin =

Obtain a binary edge image. Specify subdivisions in the -plane.

Examine the counts of the accumulator cells for high pixel concentrations. Examine the relationship between pixels in a chosen cell.

Thresholding Consider intensity histogram corresponds to an image. The segmented image g(x,y) is given by

1 if f(x,y) > T g(x,y) = 0 if f(x,y) T

where T is a constant applicable over an entire image. The process is called Thresholding

Dual thresholding is given by a if f(x,y) > T g(x,y) =


2

b if T 1 < f(x,y) T 2 c if f(x,y) T 1

where a,b,c are three distinct intensity values.

Region based segmentation The objective of segmentation is to partition an image into regions.

Region growing Region growing is a procedure that groups pixels or subregions into larger regions based on predefined criteria for growth. The basic approach is to start with a set of seed points and from these grow regions by appending to each seed points and from these grow regions by appending to each seed those neighboring pixels that have predefined properties similar to the seed.

Region splitting and merging Subdivide an image into a set of arbitrary disjoint regions and then merge and / or split the regions to satisfy the conditions of segmentation. Split into four disjoint quadrants any region Ri for which Q(Ri) = FALSE When no further splitting is possible ,merge any adjucent regions Rj and Rk for which Q(Ri
U

Rk ) = TRUE

Stop when no further merging is possible.

R1

R2

R3

R41

R42

R43

R44

Partitioned image

Corresponding quadtree R represents entire image region

R1

R2

R3

R4

R41

R42

R43

R44

Segmentation by morphological watersheds

Basic Concepts The concept of watersheds is based on visualizing an image in three dimensions: two spatial coordinates verses intensity. In such a topographic interpretation we consider three points i) points belonging to a regional minimum ii) Points at which a drop of water; if placed at location of any of those points would fall with cell certainty to a single minimum iii) Points at which water would be equally likely to fall to more than one such minimum. For a particular regional minimum, the set of points satisfying condition ii) is called the catchment basin or watershed of that minimum. The points satisfying condition iii) form crest lines on the topographic surface and are termed divide lines or watershed lines.

Dam Construction Dam construction is based on binary images ,which are members of 2D integer space Z 2 Construct dams using dilation; consider portions of two catchment basins at flooding step n -1 and at the next flooding step n. The water has spilled from one basin to the other so a dam must be built. Let M1 and M2 denote the set of coordinates of points in two regional minima. Consider the union of these sets. Connected components are dilated by first dilation and second dilation.

Watershed Segmentation Algorithm Let M1,M2,MR be the sets denoting the coordinates of the points in the regional minima of an image g(x,y) (gradient image) T(n) represent the set of coordinates (s,t) for which g(s,t) < n that is

T(n) =

(s,t) / g(s,t) < n

T(n) is the set of coordinates of points in g(x,y) lying below the plane g(x,y) = n.

It is about integer flood increments from n = min + 1 to n = max + 1 At any step n of the flooding process the algorithm needs to know the number of points below the flood depth.

Coordinates in T(n) that are below the plane g(x,y) = n are marked black and all other coordinates are marked white. R

C[n] =

U C n ( Mi ) i = 1

C [max + 1] is the union of all catchment basins R C [max + 1] = U i=1 C (Mi)

The algorithm for finding the watershed lines is initialized with

C [min + 1] = Computing C[n] from C[n - 1]

T [min + 1]

For each component q Q[n] ,there are 3 possibilities i) q C [ n - 1] is empty.

ii) q C [ n - 1] contains one connected componenent of C [ n - 1] . iii) q C [ n - 1] contains more than one connected componenent of C [n - 1]