L25 Segmentation2
L25 Segmentation2
Definition ∂f
gx ∂x
∇f = =
gy ∂f
∂y
Magnitude
2 2
1/2
∂f ∂f
∇f = mag(∇f) = [gx2 + gy2]1/2 = +
∂x ∂y
Direction
−1 gy
α(x, y) = tan
gx
Example
−2 √
∇f = ; M(x, y) = 2 2; α(x, y) = −45◦
2
Gradient operators
∂f (x, y) ∂f (x, y)
gx = = f (x + 1, y) − f (x, y) gy = = f (x, y + 1) − f (x, y)
∂x ∂y
∂f (x, y) ∂f (x, y)
Roberts: gx = = (z9 − z5) gy = = (z8 − z6)
∂x ∂y
Sobel: gx = (z7 + 2z8 + z9) − (z1 + 2z2 + z3) gy = (z3 + 2z6 + z9) − (z1 + 2z4 + z7)
Afdeling Toegepaste Wiskunde / Division of Applied Mathematics
Image segmentation (10.2.5 to 10.2.6) SLIDE 4/19
Convenient approximation:
Example 10.6
The LoG filter is first convolved with the input image f (x, y),
Summary of algorithm:
(1) Filter input image with n × n Gaussian lowpass filter (sample eqn (1))
(2) Compute the Laplacian of the result in step (1)
(3) Find the zero-crossings in the result in step (2)
Example 10.7
• Let d1, d2, d3, and d4 denote the four basic edge directions: horizontal,
−45◦, vertical, and +45◦
Afdeling Toegepaste Wiskunde / Division of Applied Mathematics
Image segmentation (10.2.5 to 10.2.6) SLIDE 15/19
Afdeling Toegepaste Wiskunde / Division of Applied Mathematics
Image segmentation (10.2.5 to 10.2.6) SLIDE 16/19
Final output image is formed by appending to gNH(x, y) all the nonzeo pixels
from gNL(x, y)
Summary: (Step (4) is typically followed by one pass of edge thinning)
(1) Smooth the input image with a Gaussian filter
(2) Compute the gradient magnitude and angle images
(3) Apply nonmaxima supression to the gradient magnitude image
(4) Use double thresholding and connectivity analysis to detect and link
edges
Afdeling Toegepaste Wiskunde / Division of Applied Mathematics
Image segmentation (10.2.5 to 10.2.6) SLIDE 18/19
Afdeling Toegepaste Wiskunde / Division of Applied Mathematics
Image segmentation (10.2.5 to 10.2.6) SLIDE 19/19