Download presentation
Presentation is loading. Please wait.
Published byRoderick Lester Modified over 8 years ago
1
Image Processing Segmentation 1.Process of partitioning a digital image into multiple segments (sets of pixels). 2. Clustering pixels into salient image regions, i.e., regions corresponding to individual surfaces, objects, or natural parts of objects.
2
Image Processing Segmentation 3.Used to locate objects and boundaries (lines, curves, etc.) in images. 4.Process of assigning a label to every pixel in an image such that pixels with the same label share certain visual characteristics.
3
Image Processing Segmentation Two of the most common techniques: thresholdingand edge finding
4
Image Processing Segmentation Two of the most common techniques: thresholding edge finding
5
Image Processing B. Detection of discontinuities The objects in image: Three basic types of gray-level discontinuities in a digital image: points, lines. edges. The original image:
6
Image Processing The common way run a mask through the image R = f(x-1, y-1) * M 1 + f(x, y-1) * M 2 + f(x+1, y-1) * M 3 + f(x-1, y) * M 4 + f(x, y) * M 5 + f(x+1, y) * M 6 + f(x-1, y+1)* M 7 + f(x, y+1)* M 8 + f(x+1, y+1)* M 9
7
Image Processing The common way run a mask through the image R = f(x-1, y-1) * M 1 + f(x, y-1) * M 2 + f(x+1, y-1) * M 3 + f(x-1, y) * M 4 + f(x, y) * M 5 + f(x+1, y) * M 6 + f(x-1, y+1)* M 7 + f(x, y+1)* M 8 + f(x+1, y+1)* M 9 Select some threshold . If |R(x,y)| then (x,y) to belong to object (background).
8
Image Processing Example a) b) Original and segmented images: a)Mask H 8 b)Threshold = 2 If R(x,y) 2 Then g(x,y) = 1 Else g(x,y) = 0 H8=H8=
9
Image Processing Line detection A masks are usualy used for detection of isolated points in an image are:
10
Image Processing Example of line detection The original I image and segmented image I o with horizotal mask
11
Image Processing Example of line detection The original I image and segmented image I 45 with 45 o mask
12
Image Processing Example of line detection The original I image and segmented image I v with vertical mask
13
Image Processing Example of line detection The original I image and segmented image I 135 with 135 o mask
14
Image Processing Example of line detection The original I image and segmented image I 8 with H 8 mask
15
Image Processing Formula: Set (x,y): R=0 for k=1 to 3 for q=1 to 3 R = R + f(x+k-2,y+q-2)*M(k,q) If R Then g(x,y) = 255(object) Else g(x,y) = 0(non-object) 1 x ImageWidth 1 y ImageHeight
16
Image Processing Egde detection:
17
Image Processing Egde detection:
18
Image Processing Gradient-based procedure:
19
Image Processing Gradient-based procedure: The function f(x) is defined as horizontal gray-level of the image. The first derivative f’(x) is positive at the point of transition into and out of the ramp as moving from left to right along the profile.
20
Image Processing Gradient-based procedure: A point M is being an edge point if its two-dimention first order derivative is greater than a specified threshold.
21
Image Processing Gradient-based procedure: If using the second- derivative to define the edge points in an image as the zero crossing of its second derivative.
22
Image Processing Gradient-based procedure: The signs of second derivative can be used to determine an edge pixel lies on the dark or light side of an edge
23
Image Processing Gradient-based procedure: The zero crossing property of the second derivative is quite useful for locating the centers of thick edges.
24
Image Processing Gradient-based procedure: The first is gradient vector of an image f(x, y), and The second is quantity (magnitude) of gradient vector
25
Image Processing The Prewitt gradient vector for detecting x-direction (y- direction) and the Prewitt gradient vectors for detecting diagonal edges: 0 1 000 0 1 111 0 1 0 11 0 0 1 0 1 0 0 11 G x = (W 2 + W 3 + W 6 ) – (W 4 + W 7 + W 8 ) G y = (W 6 + W 8 + W 9 ) – (W 1 + W 2 + W 4 ) G x = (W 7 + W 8 + W 9 ) – (W 1 + W 2 + W 3 ) G y = (W 3 + W 6 + W 9 ) – (W 1 + W 4 + W 7 )
26
Image Processing The general formula for i = 2 to Height-1 for j = 2 to Width-1 { t1 = 0 t2 = 0 for p = 1 to 3 for q = 1 to 3 { t1 = t1 + G 1 [p, q] * f[i+p-2, j+q-2] t2 = t2 + G 2 [p, q] * f[i+p-2, j+q-2]} ts = Abs(t1) + Abs(t2) if ts > thenQ[i,j] = 1 elseQ[i,j] = 0 }}
27
Image Processing Example 111311 111311 111311 333333 111311 111311 W For the window W from image I, caculating the value R(3,3) = |Dx*W| + |Dy*W| = |-6+12| + |-6+12| = 12 For all pixels of I, except boundary of I, we have matrix R: 0808 8124 0404 8 4 0000 0101 0000 0101 If using threshold at 10:
28
Image Processing The Prewitt gradient vector for detecting x-direction (y- direction) and the Prewitt gradient vectors for detecting diagonal edges:
29
Image Processing The Sobel gradient vector for detecting x- direction and y-direction edges: G 1 = (W 2 + 2W 3 + W 6 ) – (W 4 + 2W 7 + W 8 ) G 2 = (W 6 + 2W 9 + W 8 ) – (W 2 + 2W 1 + W 4 ) G x = (W 7 + 2W 8 + W 9 ) – (W 1 + 2W 2 + W 3 ) G y = (W 3 + 2W 6 + W 9 )– (W 1 + 2W 4 + W 7 ) -2 0 1 000 -2 0 2 121 0 1 The Sobel gradient vector for detecting diagonal edges : 0 12-2 0 0 1 0 1 -2 0 0 12
30
Image Processing ExamplesofSobelfilter
31
Second-order derivative: The Laplacian 0 0 4 8 0 0
32
Image Processing Second-order derivative: The Laplacian 00 0 0 0 -20 -2 16 -2 0 -20 0 0 00 The Laplacian is not used in its original form for edge detection (because of sensitive to noise). The Laplacian is combined with smoothing as a precursor to finding edges via zero-crossing.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.