1.51k likes | 3.03k Vues
DIGITAL IMAGE PROCESSING. Chapter 10 – Image Segmentation. Instructors: Dr J. Shanbehzadeh Shanbehzadeh@gmail.com M.Yekke Zare. Road map of chapter 10. 10.5. 10.3. 10.3. 10.4. 10.1. 10.1. 10.2. 10.2. 10.4. 10.5. 10.6. 10.6. Point, Line and Edge Detection. Thresholding.
E N D
DIGITAL IMAGE PROCESSING Chapter 10 – Image Segmentation Instructors: Dr J. Shanbehzadeh Shanbehzadeh@gmail.com M.YekkeZare ( J.ShanbehzadehM.YekkeZare )
Road map of chapter 10 • 10.5 • 10.3 • 10.3 • 10.4 10.1 10.1 • 10.2 • 10.2 • 10.4 • 10.5 • 10.6 • 10.6 • Point, Line and Edge Detection • Thresholding • Segmentation Using Morphological watersheds • Fundamentals • The Use of Motion in Segmentation • Image Smoothing Using Frequency Domain Filters • Region-Based Segmentation • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Fundamentals ( J.ShanbehzadehM.YekkeZare )
Fundamentals • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) . We may view image segmentation as a process that partitions R into n subregions, R1, R2, ..... R n , such that Here, Q(R k) is a logical predicate defined over the points in set R k and Q is the null set.. Condition (d) deals with the properties that must be satisfied by the pixels in a segmented region—for example, Q(R i) = TRUE if all pixels in Ri have the same intensity level.
Fundamentals • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) Segmentation algorithms for monochrome images generally are based on one of two basic categories dealing with properties of intensity values:discontinuityand similarity. In the first category, the assumption is that boundaries of regions are sufficiently different from each other . Edge-based segmentation is the principal approach used in first category. Region- based segmentation approaches in the second category are based on partitioning an image into regions that are similar according to a set of predefined criteria.
Fundamentals • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Background • Background Point, Line and Edge Detection • Detection of Isolated points Line detection • Edge Models • Basic Edge Detection • Edge Linking and Boundary Detection • More advanced techniques for Edge Detection • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Background • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) Edge pixels are pixels at which the intensity of an image function changes abruptly, edges(or edge segments) are sets of connected edge pixels. Alinemay be viewed as an 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. linesgive rise to so—called "roof edges.“
Background • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) local changes inintensitycan be detected using derivatives. first derivative (1) must be zero in areas of constant intensity; (2) must be nonzero at the onset of an intensity step or ramp; and (3) must be nonzero at points along an intensity ramp. second derivative (1) must be zero in areas of constant intensity; (2) must be nonzero at the onset and end of an intensity step or ramp; and (3) must be zero along intensity ramps.
Background • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Background • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) . In summary, we arrive at the following conclusions: (1) First-order derivatives generally produce thicker edges in an image. (2) Second-order derivatives have a stronger response to fine detail, such as thin lines, isolated points, and noise. (3) Second-order derivatives produce a double-edge response at ramp and step transitions in intensity. (4) The sign of the second derivative can be used to determine whether a transition into an edge is from light to dark or dark to light.
Point, Line and Edge Detection ( J.ShanbehzadehM.YekkeZare )
Background • Detection of Isolated points Point, Line and Edge Detection • Detection of Isolated points Line detection • Edge Models • Basic Edge Detection • Edge Linking and Boundary Detection • More advanced techniques for Edge Detection • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Detection of Isolated Points • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) we know that point detection should be based on the second derivative. theLaplacianis then
Detection of Isolated Points • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Background Line detection Point, Line and Edge Detection • Detection of Isolated points Line detection • Edge Models • Basic Edge Detection • Edge Linking and Boundary Detection • More advanced techniques for Edge Detection • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Line Detection • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) we know that for line detection we can expect second derivativesto result in a stronger response and to produce thinner lines than first derivatives.
Line Detection • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Line Detection • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Background • Edge Models Point, Line and Edge Detection • Detection of Isolated points Line detection • Edge Models • Basic Edge Detection • Edge Linking and Boundary Detection • More advanced techniques for Edge Detection • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Edge Models • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Edge Models • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Edge Models • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) the intersection between the zero intensity axis and a line extending between the extrema of the second derivative marks a point called the zero crossing of the second derivative.
Edge Models • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) the magnitude of the first derivative can be used to detect the presence of an edge at a point in an image. the sign of the second derivative can be used to determine whether an edge pixel lies on the dark or light side of an edge. two additional properties of the second derivative around an edge: (1) it produces two values for every edge in an image (an undesirable feature); (2) its zero crossings can be used for locating the centers of thick edges
Edge Models • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Edge Models • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) • three fundamental steps performed in edge detection: • 1. Image smoothing for noise reduction. The need for this step is amply illustrated by the results in the second and third columns of Fig. 10.11. • 2. Detection of edge points. As mentioned earlier, this is a local operationthat extracts from an image all points that are potential candidates to become edge points. • 3. Edge localization. The objective of this step is to select from the candidate edge points only the points that are true members of the set of points com- prising an edge.
Background Basic Edge Detection Point, Line and Edge Detection • Detection of Isolated points Line detection • Edge Models • Basic Edge Detection • Edge Linking and Boundary Detection • More advanced techniques for Edge Detection • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Basic Edge Detection As illustrated in the previous section, detecting changes in intensity for the purpose of finding edges can be accomplished using first- or second—order derivatives. We discuss first-order derivatives in this section and work with second- order derivatives in Section 10.2.6. • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Basic Edge Detection the image gradient and its properties • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) The tool of choice for finding edgestrengthanddirectionat location (x, y) of an image, f, is the gradient, denoted by f, and defined as the vector it points in the direction of the greatest rate of change off at location (x, y). Themagnitude(length) of vector f, denoted as M (x, v), where The directionof the gradient vector is given by the angle
Basic Edge Detection the image gradient and its properties • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) The direction of an edge at an arbitrary point (x, y) is orthogonalto the direction, a(x, y), of the gradient vector at the point.
Basic Edge Detection gradient operators • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Basic Edge Detection gradient operators • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) The Roberts operators are based on implementing the diagonal difference. and
Basic Edge Detection gradient operators • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) Prewitt operators And Sobel operators And the Sobel masks have better noise-suppression
Basic Edge Detection gradient operators • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Basic Edge Detection gradient operators • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Basic Edge Detection gradient operators • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation
Basic Edge Detection gradient operators • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) In general, angle images are not as useful as gradient magnitude images for edge detection, but they do complement the information extracted from an image using the magnitude of the gradient
Basic Edge Detection gradient operators • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Basic Edge Detection gradient operators • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Basic Edge Detection Combining the gradient with thresholding • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
Background • More advanced techniques for Edge Detection Point, Line and Edge Detection • Detection of Isolated points Line detection • Edge Models • Basic Edge Detection • Edge Linking and Boundary Detection • More advanced techniques for Edge Detection • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
More advanced Techniques Edge Detection The edge-detection methods discussed in the previous section are based simply on filtering an image with one or more masks, with no provisions being made for edge characteristics and noise content. In this section, we discuss more advanced techniques that make an attempt to improve on simple edge-detection methods by taking into account factors such as image noise and the nature of edges themselves. • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
More advanced Techniques Edge Detection – The Marr-hildreth edge detector • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) Marr and Hildreth argued : (1) that intensity changes are not independent of image scale and so their detection requires the use of operators of different sizes; (2) that a sudden intensity change will give rise to a peak or trough in the first derivative or, equivalently, to a zero crossing in the second derivative • These ideas suggest that an operator used for edge detection should have two salient features: First and foremost, it should be a differential operator capable of computing a digital approximation of the first or second derivative at every point in the image. Second, it should be capable of being "tuned" to act at any desired scale, so that large operators can be used to detect blurry edges, and small operators to detect sharply focused fine detail.
More advanced Techniques Edge Detection – The Marr-hildreth edge detector • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) Marr and Hildreth argued that the most satisfactory operator fulfilling these conditions is the filter ∇ 2G
More advanced Techniques Edge Detection – The Marr-hildreth edge detector • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) Collecting terms gives the final expression: This expression is called the Laplacian of a Gaussian (LoG).
More advanced Techniques Edge Detection – The Marr-hildreth edge detector • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare )
More advanced Techniques Edge Detection The Marr-hildreth edge detector • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) two fundamental ideas behind ∇2G. First, the Gaussian part of the operator blurs the imageSecond,concerns ∇2, the second derivative part of the filter. The Marr-Hildreth algorithm : g(x ,y) = [∇2G(x, y)] * f(x,y) (10.2-24) can be written also as g(x ,y) = ∇2 [G(x, y)] * f(x,y) ] (10.2-25)
More advanced Techniques Edge Detection The Marr-hildreth edge detector • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) The Marr-Hildrethedge-detection algorithm may be summarized as follows: 1. Filter the input image with an n × n Gaussian lowpass filter obtained by sampling Eq. (10.2-21). 2. Compute the Laplacian of the image resulting from Step 3. Find the zero crossings of the image from Step 2.
More advanced Techniques Edge Detection The Marr-hildreth edge detector • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation
More advanced Techniques Edge Detection The Marr-hildreth edge detector • 10.1- Fundamentals • 10.2- Point, Line and Edge Detection • 10.3-Thresholding • 10.4- Region-Based Segmentation • 10.5 - Segmentation Using Morphological watersheds • 10.6- The Use of Motion in Segmentation ( J.ShanbehzadehM.YekkeZare ) Marr and Hildreth [1980] noted that it is possible to approximate the LoG filter in Eq. (10.2 23) by a difference of Gaussians (DoG):