0% found this document useful (0 votes)
140 views

Unit 5

The document discusses image segmentation techniques. It describes how segmentation subdivides an image into constituent regions or objects based on discontinuities or similarities in pixel intensity. Discontinuity-based methods detect edges by looking for abrupt changes using masks, while similarity-based methods group similar regions. Common discontinuity detection techniques include point, line and edge detection using masks that respond strongest to certain orientations. Derivative and pattern fitting approaches are used for edge detection. Gradient and Laplacian operators are also discussed for computing first and second order derivatives to find edges.

Uploaded by

Raviteja Udumudi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
140 views

Unit 5

The document discusses image segmentation techniques. It describes how segmentation subdivides an image into constituent regions or objects based on discontinuities or similarities in pixel intensity. Discontinuity-based methods detect edges by looking for abrupt changes using masks, while similarity-based methods group similar regions. Common discontinuity detection techniques include point, line and edge detection using masks that respond strongest to certain orientations. Derivative and pattern fitting approaches are used for edge detection. Gradient and Laplacian operators are also discussed for computing first and second order derivatives to find edges.

Uploaded by

Raviteja Udumudi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Unit 5

IMAGE SEGMENTATION

IMAGE SEGMENTATION 5.1 INTRODUCTION:


Segmentation subdivides image into its constituent regions or objects. The level to which the sub-division is carried depends on the problem being solved i.e., segmentation should stop when the objects of interest in an application have been isolated. Segmentation of non-trivial images is one of the most difficult task in image processing. Segmentation accuracy determines the eventual success or failure of computerized analysis procedures. For this region considerable care should be taken to improve the probability of rugged segmentation. Image segmentation algorithm generally are based on one of two basic properties of intensity values, such as Discontinuity and Similarity. In discontinuity the approach is to partition an image based on abrupt changes in intensity such is edges in an image. Similarity is based on partitioning an image into region that are similar according to set of predefined criteria.

5.2 DETECTION OF DISCONTINUTIES:


There are three basic types of discontinuities in digital image. Points, lines and edges. In practice, the most common way to look for discontinuities is to run a mask through the image for 3x3 mask shown in fig., this procedure involves computing the sum of products of the coefficients with the gray levels contained in the region encompassed by the mask i.e., the response of the mask at any point of image R= .(4.8) = Where Z1 is the gray level of the pixel associated with mask coefficients W1. As usual the response of the mask is defined with respect to its centre location. When the mask is centered on a boundary pixel, the response is computed by using the appropriate partial neighborhood. -1 -1 -1 -1 8 -1 -1 -1 -1

5.2.1 POINT DETECTION: The detection of isolated points in an image is straight forward using the mask shown in fig(a) we can say that a point has been detected at the location on which the mask is centered if | | . Where T is non-negative threshold R is response of the mask at any point in the image. Basically, all that this formulation does is measure the weighted differences between the centre point and its neighbors. The idea is that the gray level of an isolation point will be quite different from the gray level of its neighbors. The mask in fig. is the same mask used for high frequency spatial filtering. The emphasis hue is strictly on the detection of points i.e., only differences that are large enough to be considered isolation points in an image of interest.

Unit 5

IMAGE SEGMENTATION

5.2.2 LINE DETECTION: Line and edges features in any scene from simple indoor scenes to noisy terrain images taken by satellite. Most of the earlier methods for detecting lines were based on pattern matching. The patterns directly followed from the definition of a line. These pattern templates are designed with suitable coefficients and are applied at each point in image. A set of such templates shown in fig(b) if the first mask were moved around an image, it would response would result when the line passed through the middle row of the mask. This is easily verified by sketching a simple array of 1s with a line of different gray level running horizontally through the array. A similar experiment would reveal that the second mask in the same fig responds best to lines oriented at 45*, the third mask to vertical lines; and fourth mask to lines in the -45* direction. These directions can also be established by noting that the preferred direction of each mask is weighted with large coefficient i.e., 2 than other possible directions. Let R1,R2,R3 and R4 denote the response of the mask in fig, from left to right, where Rs are given by eq. suppose that all masks run through an image. If at a certain point in the image | | | | , for all j i that point is said to be more likely associated with a line in the direction of mask DOUBT. Example if at a point in the image, | | | | for j=2,3,4 that particular point is said to be more likely associated with horizontal line.

5.2.3 EDGE DETECTION: In a gray scale image, an edge is local feature that, with in a neighborhood, separates two region in each of which the gray level is more or less uniform with different values on the two sides of the edge. So, an ideal edge has a step like cross-section (1)a and (1)b DOUBT the cross-section of a more realistic edge which has a shape of ramp function corrupted with noise. The process of edge detection are broadly classified into two categories.

(a)

(b)

Derivative Approach: Edge pixels or edges are detected by taking derivative followed by thresholding. They occasionally incorporate noise cleaning scheme. Two dimensional derivatives are computed by means of edge masks.
2

Unit 5

IMAGE SEGMENTATION

Pattern Fitting Approach: A series of edge approximating functions in the form of edge templates over a small neighborhood are analyzed. Parameters along with their properties corresponding to the best fitting functions are determined. Based on these information, whether or not an edge is presented is decided when also called them as edge filters. Fig1(a) shows the first approach i.e., the derivative approach shows an image of a light strip on a dark background, the graylevel profile along a horizontal scan line of the image, and the first and second derivatives of the profile. Not from the profile that an edge is modeled as a smooth rather as an abrupt, change of gray level. This model reflects the fact that edges in digital images are generally slightly blurred as a result of sampling. Fig1(b) shows that the first derivative of the gray level profile is +ve at the leading edge of a transition, -ve at the trailing edge, and as expected, zero in areas of constant gray level. The second derivative is +ve for that part of the transition associated with the dark side of the edge, -ve for that part transition associated with the light side of the edge, and zeros in areas of constant gray level. Hence the magnitude of the first derivative can be used to detect the presence of an edge in an image, and the sign of second derivative can be used to determine whether an edge pixel lies on the dark or light side of an edge. Note that second derivative has a zero crossing at the mid point of a transition in gray level. Zero crossing provides a powerful approach for locating edges in an image. Although the discussion has been limited to a 1D horizontal profile, a similar argument applies to an edge of orientation in an image Image

Profile of a horizontal line

first derivative

second derivative

(a) Light strip on a dark background

(b) Dark strip on a light background

Gradient Operators: First order derivatives of a digital image are based on various approximations of the 2D gradient. The gradient of an image f(x,y) at location (x,y) is defined as the vector. f=[ ] [ ]. (4.9)

Unit 5

IMAGE SEGMENTATION

It is well known form vector analysis that the gradient vector points in the direction of maximum rate of change of f at co-ordinates (x, y). An important quantity in edge detection is the magnitude of this vector, denoted f where f = mag.(f) = (4.91) This quantity gives the maximum rate of increase of f(x, y) per unit distance in the direction of f. it is common practice to refer to f also as the gradient. Differentiating between the vector and its magnitude only in cases in which confusion is likely. The direction of the gradient vector also is an important quantity. Let (x, y) represents the direction angle of the vector f at (x, y). Then from vector analysis, (x, y) = * +. (4.92)

Where the angle is measured with respect to the x-axis. The direction of an edge at (x,y) is perpendicular to the direction of the gradient vector at that point. Computation of gradient of an image is based on obtaining the partial derivatives at every pixel location. Derivatives can be implanted in digital form in several ways. However, the sobel operator have the advantage of providing both a differencing and smoothing effect. Because derivates enhance noise, the smoothing effect is a particularly attractive feature of the sobel operators from the figure derivatives based on the sobel operator masks are ( and ( ) ) ( ( ) ) (4.93)

Where the Zs are the gray levels of the pixels overlapped by the masks at any location in an image computation of the gradient at the location of the centre of the masks then utilizes the eq.(3) which gives the value of gradient. To get the next value, the mask are moved to the next pixel location and the procedure is repeated. Thus, after the procedure has been completed for all possible locations, the result is gradient image of same size as the original image, as usual, mask operations on the border of an image are implemented by using the appropriate partial neighbors. 3X3 IMAGE REGION -1 0 1 -2 0 2 -1 0 1 at the centre point -1 -2 -1 0 0 0 1 2 1 at that point

Mask used to compute

Mask used to compute

Unit 5

IMAGE SEGMENTATION

Laplacian Operation: Given an image matrix, the laplacian of the image function is the second order partial derivative along x and y direction. for a 3x3 region, The form most frequently encountered in practice is ( ) (4.10) where the Z is the gray level of the pixel associated with the mask the coefficient. The basic requirement in defining the digital laplacian is that the coefficients associated with the outer pixel be ve. Because the laplacian is derivative, the sum of the coefficients has to be zero. Hence the response is zero whenever the point in question and its neighbors have the same value shows a spatial mask that can be used to implement eq.(2). Mask used to compute the Laplacian 0 -1 0 -1 4 -1 0 -1 0

Although, the laplacian responds to transitions in intensity, it is seldom used in practice for edge detection for several reasons. As a second-order derivative, the laplacian is unacceptably sensitive to noise. Moreover, the laplacian produce double edges and is unable to detect direction. For these reasons, the laplacian usually plays the secondary role of detector for establishing whether a pixel is on the dark or light side of an edge. A more general use of the laplacian is in finding the location of edges using the zero-crossing property. This concept is based on convolving an image with the laplacian of a 2D Gaussian function of the form h(x, y) = exp* + where is the standard deviation then from the equation * + * +.(4.10.1)

the laplacian of h is

T -

Fig shows a cross section of this circularly symmetry function, the smoothness of the function its zero crossing at r = and the positive centre and negative skirts. Shape is model upon eq.(2) and the mask in the fig are based. When viewed in 3D perspective with the vertical axis corresponding to intensity eq(4) has a classical Mexican hat shape. It can be shown that the average value of the laplacian operator is zero.
5

Unit 5

IMAGE SEGMENTATION

The same is true of a laplacian image obtained by convolving this operator with a given image. Convolution, of an image with a function of the form, blurs the image, with the degree of blurring being proportional to . Although this property has value in terms of noise reduction, the equation 4 lies in its zero crossings. The preceding discussion has one further implication edge detection by gradient operations tends to work well in cases involving images with sharp intensity transitions and relatively low noise. Zero crossing offers an alternative in cases when edges are blurry or when a high noise content is present. The zero crossing offers reliable edge location, and smoothing properties of reduce the effect of noise. The DOUBT paid for these advantages is increased computational complexity and time.

5.3 REGIONS- BASED OPERATIONS:


The main idea in region based segmentation techniques is to identity various regions in an image that have similar features. These approaches are generally less sensitive to noise than the boundary based methods. However their complexity can after be quite large. 5.3.1 BASIC FORMULATION: Let R represent the entire image region. We may view segmentation as a process that partitions R into such that 1. 2. is a connected region, i=1,2,3,n 3. for all i and j, ij 4. P( ) = True for i=1,2,3,.n and 5. P( ) = False for I j Where P( ) is a logical predicate over the points in set and is the nulset.

a) Indicating that segmentation must be complete, i.e., every pixel must be in a region, b) Requires tat points in a region must be connected. c) Indicate the region must be disjoint. d) Deals with the properties that must be satisfied by the pixel in a in a segment region for example P( ) = True if all pixels in have the same intensity. Indicates that region are different in the sense of predicate P.

1) Region Growing 2) Region merging 3) Region formation 4) Region splitting 5) Split and merge 5.3.2 REGION GROWING: It is the simplest approach to image segmentation. Neighboring pixel of similar amplitude are grouped together to form a segmented region. Arbitrary pixel (r, c) from the domain of the image to be segmented is called seed pixel. This pixel belongs to some other region. Examine the nearest neighbors of (r, c) one by one A neighboring pixel is accepted to belong to the same region as (r, c) if they together satisfy the homogeneity property of a region. Once a new pixel is accepted as a member of the current region the nearest neighbors of this new pixel are examined. This process goes on recursively until no more pixel is accepted. All the pixels of current regions are masked with a unique label. Then the other seed pixel is picked up and the same procedure is repeated.
6

Unit 5

IMAGE SEGMENTATION

Labeling regions until every pixel is assigned to some regions or the other. The main problem of this approach in addition to large execution time are, The selection of the property to be satisfied. The selection of seed points (suppose the smooth regions in an image corresponds to the planar surface of the scene or object. The variance in gray level of pixel within a region should be small). This leads to a property or more specifically homogeneity property, to be satisfied by the gray levels of pixels lying within a region. When the threshold decreases tiny regions would come vice-versa. When the threshold increases more and more pixels are included in the region, the pixels that have gray levels with higher variations are accepted because of averaging. To avoid this problem, the homogeneity property for a small range of gray levels of pixels. In a region and define the property as Region R1 boundary Common

Region R2 Prof(R) : max {g(r, c)} min {g(r, c)} < +h (r, c) R Assigning one pixel at a time as a member of current region is the simplest approach to region growing. This is one of the slowest approach as well. A better approach is to be considered a small region at a time instead a single pixel. Depending on the property to be satisfied this region based approach is more robust to noise than the pixel based approach. 5.3.3 REGION SPLITTING: We divide the region into four equal quadrants, if the property is satisfied, we leave the region as it is. This is done recursively until all the regions satisfy the property. In graph theory region is called as a node. Then the node is split into four children if the node does not satisfy the given property otherwise the node is left unaffected. The former node is called a parent node and the latter a leaf node. This method is applicable to images whose number of rows and number of columns are some integer power of 2. We start the method taking the whole image that means the image is taken as the root node and a quad tree is formed where each leaf node represents a rectangular homogenous region.

Unit 5

IMAGE SEGMENTATION

(a)

Partitioned image

(b) corresponding quad tree

5.3.4 REGION MERGE: Region merging is exactly opposite to the region splitting method. Splitting method is a top down method while merging is bottom up method. It is applicable to images whose number of rows and number of columns are some integer power of 2. In merging we start from the pixel level and consider each of them a homogenous regions arranged in 2x2 fashion together satisfies the homogeneity property. If yes we merge those regions to a single homogenous region, otherwise the regions are left as they are, In terms of graph theory child nodes are removed if the parent node satisfies the homogeneity property otherwise child nodes are declared as leaf node. We repeat this operation recursively until there are no more regions that can be merged. 5.3.5 SPLIT AND MERGE: The split technique starts with the whole images as one region and splits a region into four sub-regions until the sub-regions satisfy the predefined homogeneity property. Merge technique starts by taking each pixel a region and merge small regions into a larger region if the DOUBT satisfies the predefined homogeneity property. Most of the homogenous regions are small, then split technique in interior to merge technique in terms of time requirement. Reverse is true if most of the regions are large. Hence if no prior knowledge is available about size of the regions, a hybrid of above two approaches are employed. Method starts from middle level. It start with rectangular region of size MxN pixels. To each region homogeneity property is tested. If test fails, the region is split into four quadrants each of size (M/2)x(M/2) and the process is carried on recursively. If the region satisfies the homogeneity property then merging process is followed to form a region of size 2Mx2M. Exact implementation of the method and its time complexity depends on the date structure used.

5.4 THRESHOLDING:
5.4.1 FOUNDATION: An image f(x, y), composed of light objects on a dark background in such a way that objects 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 f(x, y) > T is called an object point otherwise, the point is called a background point.

Unit 5

IMAGE SEGMENTATION

. Two types of light objects on a dark background, here multi-level thresholding classifies a ( ) point (x, y) as belonging to one object class if to the other objects class if f(x, y) > T and to the background if f(x, y) . In general segmentation problems requiring multiple thresholds are best solved using region growing methods. When T depends only on f(x, y) (i.e., only on gray level value) the threshold is called global if T depends on both f(x, y) and P(x, y), the threshold is called local (Where P(x, y) local properties of a point). When T depends on the spatial co-ordinates x and y the threshold is called dynamic or adaptive. 5.4.2 ROLE OF ILLUMINATION: Image f(x, y) is formed as the product of reflectance component r(x, y) and illumination component i(x, y). This model discuss the global thresholding. Consider the computer generated reflectance function shown in fig(a). The histogram is shown in fig(b) it is clearly bimodal and could be partitioned easily by placing a single global threshold T in the histogram valley. Multiplying the reflectance function in a by illumination function shown in fig(c) yields the image shown in (d) fig(e) shows the histogram of this image. The original valley was virtually eliminated, making segmentation by a single threshold an impossible task. Illustration shows that the reflective nature of the object and background could be quite difficult to segment. When access to the illumination source is available, a solution frequently used in practice to compensate for non-uniformly is to project the illumination pattern on to a constant, white reflective surface. This yields an image g(x, y) = k i(x, y) k is constant depends on the surface and i(x, y) is the illumination pattern. Then for the image f(x, y) = i(x, y) r(x, y) obtained with the same illumination function, simply dividing f(x, y by g(x, y) yields a normalized function h(x, y) = f(x, y) / g(x, y) = r(x, y) / k. Thus, if r(x, y) can be segmented by using a single threshold T, then h(x, y) can be segmented by using a threshold of value / k. 5.4.3 BASIC GLOBAL THRESHOLDING: T depends on only f(x, y) (the gray level values). Partition the image histogram by single global threshold T. Segmentation is accomplished by scanning the image pixel by pixel and label each pixel as object or background, depending on whether the gray level of that pixel is greater or less than the values of T. Objects are darker than the background, so any pixel with a gray level T was labeled black (0). Pixel with >T labeled white (255). The threshold was specified by using heuristic approach, based on visual inspection of the histogram. The following algorithm can be used to obtain T automatically. Select an initial estimate for T. Segment the image using T. This will produce two groups of pixels. G1 consisting of all pixels with gray level value >T. G2 consisting of pixels with T.
9

Unit 5

IMAGE SEGMENTATION

Compute the average gray level values and for the pixel in regions G1 and G2. Compute new threshold values T = ( ) Repeat steps 2 through 4 until the difference in T in successive iterations is smaller than a predefined parameter T0. Note: A more appropriate initial value for T0 is required to give difference between two pixels as less (i.e., the intensity level difference) a good grouping of pixels of a region. T is used to reduce iterations and the case T threshold cannot be achieved. 5.4.4 BASIC ADAPTIVE THRESHOLDING: In even illumination can transform a perfectly segment histogram into a histogram that can not be partitioned effectively by a single global threshold. An approach to handle this situation is to divide the original image into sub-images and then utilize a different threshold to segment each sub-image. The threshold used for each pixel depends on the location of pixel in terms of sub-images, this type of thresholding is adaptive. One approach to reduce the effect of non-uniform illumination of each sub-image is approximately uniform. Partition, image into four equal parts, and then sub-dividing each part by four again. All the sub-images that didnt contain a boundary between object and background had variance of <75. All sub-images containing had variances in excess of 100. Each sub-image with variance greater than 100 was segmented with a threshold computed for that sub-image using the algorithm. The initial value for T in each case was selected as the point midway between the min. and max. gray levels in the sub-image. All the sub-images with variance less than 100 were treated as one composite image, which was segmented using a single threshold estimated using the same algorithm. 5.4.5 OPTICAL GLOBAL AND ADAPTIVE THRESHOLDING: This method is for estimating thresholds that produce the minimum average segmentation error. Suppose that an image contains only two principal gray level regions, let 2 denote gray level values. Which can be viewed as the values as random quantities and their histogram may be considered an estimate of their probability density function P(z). This overall density function is the sum of mixture of two densities one for light and other for dark region in the image. Furthermore, the mixture parameters are proportional to relative areas of the dark and light regions. If the form of densities is known are assumed it is possible to determine an optimal threshold (in terms of min error) for segmenting the image in the two distinct regions. P(Z) ( ) ( )

Fig shows two probability density functions larger PDF corresponds to background levels small PDF corresponds to object gray level values in the image. The mixture PDF describing the overall gray level variations in the image is P(Z) = ( ) ( ) (4.11) Where P1 and P2 are probability of occurrences of two classes of pixels i.e., P1 is the probability (a number) that a random pixel with value 2 is an object pixel P2 is background pixel. Assuming that any given pixel belongs either to an object or the background P1 + P2 = 1
10

Unit 5

IMAGE SEGMENTATION

An image is segmented by classifying as background all pixels with gray levels greater than the threshold T. All other as object pixels. Select the value of T that minimizes the average error in making decision that a given pixel belongs to an object or to the background. The probability of erroneously classifying a background point as an object point is ( ) ( ) (4.11.1)

This is the area under the curve of P2(z) to the left of the threshold. Similarly the probability of erroneously classifying an object point in background is ( ) ( ) (4.11.2)

Which is the area under the curve of P1(z) to right of T. then the overall probability of error is E(T) = ( ) ( ) (4.11.3) E1 and E2 are weighted (given importance) by the probability of occurrence of object or background pixels. For example consider the extreme case in which background point are known never to occur in that case . The contribution to overall error (E) of classifying a background point as object point E1 should be zeroed out because background points are known never to occur which is accomplished by E1xP2 which is T. If background and object points are equally like to occur, then the weights are P1=P2= 0.5. To find the threshold value for which error is minimal requires differentiating E(T) with respect to T (using Leibnizs rule) and equating the results to 0. The result is ( ) ( ).. (4.11.4)

This equation is solved for T to find the optimum threshold. Note that if P!=P@ then the optimum threshold is where the curve for P1(z) and P2(z) interests. Use of boundary characteristics for histogram implement and local thresholding: The approach for improving the shape of histogram is to consider only those pixel that lie on or near the edges between objects and the background. An immediate and obvious improvement is that histogram would be less dependent on the relative sizes of objects and the background. If only the pixels on or near the edge between object and the background were used, the resulting histogram would have peaks of approximately the same height. Using pixels that satisfy some simple measures based on gradient and laplacian operators has a tendency to depend the valley between histogram peaks. The principal problem with this approach is the implicit assumption that the edges between objects and background are known. This information clearly is not available during segmentation. An indication of whether a pixel is on an edge may be obtained by computing its gradient. In addition use of the laplacian can yield information regarding whether a given pixel lies on dark or light side of an edge. The gradient f at any point (x, y) in an image and the laplacian, these two quantities may be used to form a 8-level image as follows (x, y)= { Where the symbols 0, + and represents any three distinct gray levels, T is threshold and gradient and laplacian are computed at every point (x, y). (4.11.5)

11

Unit 5

IMAGE SEGMENTATION

For dark object, light background: All the pixels that are not on an edge are labeled 0. All the pixels on the dark side of the edge are labeled +. All the pixels on the light side of the edge are labeled -. The symbol + and - are reverse for light object, dark background. The information obtained with this procedure can be used to generate a segmented, binary image in which 1s corresponds to object of interest and 0 corresponds to the background. 5.4.6 THRESHOLD BASED ON SEVERAL VARIABLES: Color image in which each pixel is characterized by three RGB values. In this case each pixel its characterized by three RGB values. Constructing a 3D histogram becomes possible. The basic procedure is analogous to the method used for one variable for example for an image with 3-variables (RGB components) each having 16 possible levels, a 16x16x16 grid (cube) is formed. Inserted in each cell of the cube is the number of pixels whose RGB component have values corresponding to the co-ordinate defining the location of that particular cell. Each entry is then divide by the total number of pixels in the image to form a normalized histogram. The concept of thresholding now becomes one of finding clusters of points I 3D space. For example, that K significant clusters of points are found in the histogram. The image can be segmented by assigning one arbitrary value (say white) to pixel whose RGB components are closer to the other pixel in the image. This concept is easily extendable to more components and certainly to more cluster. The principal difficulty is that cluster seeking becomes an increasingly complex task as the number of variables increases.

5.5 EDGE LINKING AND BOUNDARY DETECTION


Because of noise breaks in the edge from uniform illumination, and other effects that introduce spurious intensity discontinuities. Thus edge detection algorithm typically are followed by linking procedures to assemble edge pixels into meaningful edges. Several basic approaches are suited to this purpose. 5.5.1 LOCAL PROCESSING: One of the simplest approaches for linking edge points is to analyze the characteristics of pixels in a small neighborhood in a small neighborhood about every point (x, y) in an image that has been labeled an edge point by one of the techniques. All points that are similar according to set of predefined criteria are linked, forming an edge of pixel that share those criteria. The two principal properties used for established similarity of edge pixels in this kind of analysis are, The strength of the response of the gradient operator used to produce the edge pixel. The direction of the gradient vector. The first property is given by the value of f . Thus an edge pixel with co-ordinates (x0, y0) in a predefined neighborhood of (x, y) is similar in magnitude to the pixel at (x, y) if | ( ( ) ) ( )| .. (4.12) Where E is non negative threshold. The direction (angle) of the gradient vector is given by ( ).(4.12.1)

An edge pixel at (x0, y0) in the predefined neighborhood of (x, y) has an angle similar to the | ( ) pixel at (x, y) if ( )| Where A is a non ve angle threshold noted in eq(2) the direction of the edge at (x, y) is perpendicular to the direction of the gradient vector at that point.

12

Unit 5

IMAGE SEGMENTATION

A point is predefined neighborhood of (x, y) is linked to the pixel at (x, y) if both magnitude and direction criteria are satisfied. This process is repeated at every location in the image. A record must be kept of linked points as the centre of the neighborhood is moved from pixel to pixel. A simple book keeping procedure is to assign a different gray level to each set of linked edge pixels. 5.5.2 GLOBAL PROCESSING VIA THE HOUGH TRANSFORM: Here the points are linked by determining first if they lie on a curve of specified shape. Given n points that lie on straight lines. One possible solution is to first find all the lines determined by every pair of points and then find all subsets of points that are closed to particular lines. ( ) The problems with this procedure is that it involves finding lines and then performing (n)(n(n-1))/2 comparison of every point to all lines. This approach is prohibitive in all but the most trivial applications. In year[1962] Hough proposed an alternative approach, commonly referred to as the Hough transform. Consider a point (Xi, Yi) and the general eq. of the straight line in scope intercept form, (y = m x + c). Infinitely many lines pass through (Xi, Yi), but they all satisfy the eq. for varying values of a and b. However, writing this eq. as b= [(i.e., y=a ; m= ; x=a ; c= ) or (b= ( )+c)] and considering ab-plane also called parameter space yields the eq. of a single line for a fixed pair (Xi, Yi). Further more, a second point (Xj, Yj) also has a line in parameter space associated with (Xi, Yi) at (a, b), where a, is the slope and b is the intercept of the line containing on this line have lines in parameter space that intersects at (a, b). y ( ) a ( ) b= X (a) xy- plane a (b) parameter space b b= b

The computational attractiveness of the Hough transform arises from sub-dividing the parameter space into so called accumulator cells. As illustrated in the fig where ( ) & ( ) are the expected ranges of slopes and intercept values. The cell at coordinates (i, j), with accumulate value A(i, j) corresponds to the square associated with parameter space co-ordinates ( ). Initially, these cells are set to zero. Then for every point ( ) in the image plane, we let the parameter a equal each of the allowed subdivision values on the a-axis and solve for the corresponding b using the eq. b== . The resulting bs are then rounded off to the nearest allowed values in the b-axis if a choice of results in solution , we let A(p, q)= A(p, q) +1. At the end of this procedure, a value of Q A(i, j) corresponds to Q points in the xy-plane lying on the line y=a . The number of sub-divisions in ab-plane determines the accuracy of co-linearity of these points.

13

Unit 5

IMAGE SEGMENTATION

0 . . . . . a sub-division of parameter plane .

The sub-dividing the a-axis into K increments gives for every point. ( ) , K values of b corresponding to K possible values of a. With n image points, this methods involves nk computations. Thus the procedure is linear in n, and the product does not approach the number of computations. A problem with the eq. y= a x + b to respect a line is that the slope approaches infinity as the line approaches the vertical. One way around this difficulty is to use the normal representation of a line. y . . x . . The above fig illustrates the geometrical interpretation of parameters used in the eq. x +y . The use of this representation in constructing a table of accumulators is identical to the method discussed for the slope-intercept representation. Instead of straight lines however, the loci are sinusoidal curves in the P - plane. As before, Q collinear points lying on a line x +y yield Q sinusoidal curves that interest at ( ) in the parameter space incrementing and solving for the corresponding P gives Q entries in accumulator A(i, j) associated with the cell determined by ( ) illustrates the subdivision of the parameter space. The range of angle is , measured with respect to the x-axis. Thus with reference to the fig(a) a horizontal line has = , with being equal to the +ve x-intercept. Similarly, a vertical line has = with being equal to the positive y-intercept or = with being equal to the negative y-intercept. Fig shows illustrates Hough transform (a) shows an image with 5 label points. Each of these points is mapped onto -plane, Fig(b) the range of value is 90, and the range of the axis is 2D where D is the distance between corners in the image. The horizontal line
14

. .

Unit 5

IMAGE SEGMENTATION

resulting from the mapping of point 1 is a special case of sinusoidal with zero amplitude. Colinearity detection property of Hough transform illustrates in fig(c) point A denotes the intersection of the curves corresponding to points 1, 3 & 5 in xy-image plane. The location of point A indicates that these 3 points lie on a straight line passing through the origin ( = 0) and oriented at -45*. The curves intersecting at point B in the parameter space indicate that points 2, 3 & 4 line on a straight line oriented at 45* and whose distance from the origin is one half the diagonal distance from the origin of the image to the opposite corner. Fig(d) indicates the fact that the Hough transform exhibits a reflective adjacency relationship at the right and left parameter space. This property, shown by the points marked A, B and C in fig(d) is the result of the manner in which and changes sign at the 90 boundaries. Hough transform is applicable to any function of the form g(v, c)= 0, where v is a vector of co-ordinate and C is a vector coefficients. An approach based on the Hough transform is as follows: Compute the gradient of an image and threshold it to obtain a binary image. Specify subdivisions in -plane. Examine the counts of the accumulator cells for high pixel concentration. Examine the relationship (principally for continuity) between pixels in a chosen cell. The concept of continuity in this case usually is based on computing the distance between disconnected pixels identified DOUBT of the set of pixels corresponding to a given accumulator cell. A gap at any point is significant if the distance between the point and its closest neighbor exceeds a certain threshold. 5.5.3 GLOBAL PROCESSING VIA GRAPH-THEORITIC TECHNIQUES: Global approach for edge detection and linking based on representating edge segments in the form of a graph and searching the graph for low cost paths that corresponds to significant edges. This representation provides a rugged approach that performs well in the presence of noise. 1) The procedure is considerably more complicated and requires more processing time. 2) Edge detection using 3x3 image shown. The outer number are pixel coordinator and the no. in the brackets represent gray level values. 3) Each edge elements, defined by pixels P and Q has an associated cost defined as C(p, q) = H [f(p) f(q)] Where H is the highest value in the image F(P), f(Q) are the gray level values of P & Q 4) By convention the point P is on the right hand side of the direction of travel along edge elements. 5) For example the edge segment (1, 2) (2, 2) is between points (1, 2) and (2, 2). If the direction of travel is to the right, then P is the point with co-ordinate (2, 2) and Q is point with co-ordinates (1, 2) C(p, q) = 7 - [ 7 6 ] = 6 6) The direction is left between the same two points, then P is point (1, 2) and Q is (2, 2) C(p, q) = 7 [ 6 - 7 ] = 8 7) To simplify the discussion, we assume the edges start in top row and terminal in the last row, so that the first element in the edge can be only between point (1, 1), (1, 2) or (1, 2), (1, 3) similarly the last edge element has to be between points (3, 1), (3, 2) or (3, 2), (3,3).

15

Unit 5

IMAGE SEGMENTATION

b) Edge segment and their cost c) Edge correspondingth lowest cost path Fig(d) shows the graph for this problem. Each node (rectangle) in the graph corresponds to an edge element from fig(a) are exists between two nodes if the two corresponding edge elements taken in succession can be part of an edge in fig(b), the cost of each edge segment computed using is shown in box on the side of the leading into the corresponding node.Goal nodes are shown shaded the minimum cost path is shown dashed and the edge corresponding to this path is shown in fig(c). in general, the problem of finding a minimum cost path is non trivial in terms of computation. Typically, the approach is to sacrifice optimality for sake of speed, and the following algorithm represents a class of procedures that use heuristics in order to reduce the search effort. Let r(n) be an estimate of the cost of a minimum cost path from the start node S to a goal node, where the path is constrained to go through n. This cost can be expressed as the estimate of the cost of a minimum cost path from S to n plus an estimste of the cost of that path from n to a good node i.e., r(n) = g(n) + h(n). An algorithm that uses r(n) as the basis for performing a graph search is follows 1. Mask the start node OPEN and set g(s)=0 2. If no node is OPEN exit with failure; otherwise continue. 3. Mark CLOSED the OPEN node n whose estimate r(n) computed r(n)=g(n)+h(n) is smallest. 4. If n is a goal node, exit with the solution path obtained by tracing back through the pointers; otherwise continue. 5. expose node n, generating all of its successors (no. successor go to step2) 6. If a successor is not marked, set r( ) = g(n) + c(n, ), mark it OPEN and direct pointers from it back to 7. If a successor is marked CLOSED or OPEN, update its value by letting ( ) ( ( ) ( ) ( )) Mark OPEN those CLOSED successors whose g values were thus lowered and redirect to the points from all nodes whose g values were lowered to go to step 2. Note: This algorithm does not guarantee a min cost path, its advantage is speed via the use of heuristic.

a) 3x3 Image region

16

You might also like