edge detection
play

Edge Detection l Why Detect Edges? u Information reduction l Replace - PDF document

Edge Detection l Why Detect Edges? u Information reduction l Replace image by a cartoon in which objects and surface markings are outlined create line drawing description l These are the most informative parts of the image u Biological


  1. Edge Detection l Why Detect Edges? u Information reduction l Replace image by a cartoon in which objects and surface markings are outlined ⇒ create line drawing description l These are the most informative parts of the image u Biological plausibility l Initial stages of mammalian vision systems involve detection of edges and local features u Applications l Object recognition, stereo, texture analysis, motion analysis, image enhancement, image compression 1 What Causes Image Intensity Changes? Many types of physical events cause intensity changes l u Surface reflectance discontinuity - change in the fraction of light incident on the surface that is reflected to viewer u Illumination discontinuity - shadow u Surface orientation (normal) discontinuity u Depth discontinuity - at occluding contour, where surface orientation is perpendicular to line of sight 2 1

  2. What type of real-world edge is this contrast border? 3 Need global information too 4 2

  3. What Does an Edge Look Like? l Step l Ramp l Roof l Line (bar) 5 6 3

  4. fine scale high threshold 7 coarse scale, high threshold 8 4

  5. coarse scale low threshold 9 Edge Detectors in the HVS Simple (border) Complex l Sum activity from an array of oriented simple cells 10 5

  6. Orientation Columns in V1 l A “hypercolum” = complete set of orientations 11 Craik-O’Brien-Cornsweet Illusion 12 6

  7. Koffka Ring 13 Luminance Differences Affect our Perceptions l Artists use the technique of “equiluminance” to blur outlines and suggest motion . We cannot perceive the edges of objects where object and background have the same luminance. If parts of a painting are equiluminant, their positions become ambiguous. They may seem to shift position or to float l Equiluminant colors have special properties, e.g., they can make a painting appear unstable 14 7

  8. Equiluminant Colors l An object that can be seen by both subdivisions of the visual system will be perceived accurately. But if the two subdivisions are not balanced in their response to an object, it may look peculiar. l For example, an object defined by equiluminant colors can be seen by the What system but is invisible (or poorly seen) by the Where system. It may seem flat, it may seem to shift position, or it may seem to float ambiguously because there is too little luminance contrast to provide adequate information about its three-dimensional shape, its location in space, or its motion (or lack of it). l Conversely, something defined by very low contrast contours is seen by the Where system but not the What system and may seem to have depth and spatial organization but no clear shape. 15 Detail from Richard Anuszkiewicz’s Plus Reversed , 1960 ������������������������������������������������������������������ 16 8

  9. Edge Detection Goals l Good detection : Low false alarm rate and low false dismissal rate ⇒ maximize signal-to-noise (S/N) ratio l Good localization : Mark point closest to “center” of true edge ⇒ minimize distance between marked point and center l Uniqueness : Only one response to a single edge l Good property measurement : Orientation, contrast, etc. 17 Edge Operator Properties l Shift invariant (translation invariant, position invariant) u If g(x,y) = Op[f(x,y)] then g(x-a, y-b) = Op[f(x-a, y-b)] l Isotropic (rotation invariant) vs. non-isotropic l Derivative order (if differentiation-based method) l Linear vs. non-linear u Op[a f 1 (x,y) + b f 2 (x,y)] = a Op[f 1 (x,y)] + b Op[f 2 (x,y)] = a g 1 (x,y) + b g 2 (x,y) l Scale (operator neighborhood size) u g(x,y) = Op[f(x+a, y+b), ∀ -k < a, b < k ] l Convolution (linear and shift-invariant) 18 9

  10. Edge and Local Feature Detection Methods l Gradient-based edge detection l Edge detection by function fitting l Second derivative edge detectors l Edge linking and the construction of the chain graph 19 1D Edge Detection l An ideal edge is a step function I (x) x I ′ (x) x 20 10

  11. 1D Edge Detection I ′′ (x) x l The first derivative of I (x) has a peak at the edge l The second derivative of I (x) has a zero crossing at the edge 21 1D Edge Detection l More realistically, image edges are blurred and the regions that meet at those edges have noise or variations in intensity u Blur - high first derivatives near edges u Noise - high first derivatives within regions that meet at edges I ′ (x) I (x) x x 22 11

  12. Edge Detection in 2D l Let I (x,y) be the image intensity function. It has derivatives in all directions u ∂ I ( x , y )/ ∂ x = lim I ( x + ∆ x , y ) - I ( x , y ) / ∆ x ≈ I ( u +1, v ) - I ( u,v ) u Gradient of I (x, y) is a vector ∇ ∇ ∇ I (x, y) = [ ∂ I / ∂ x, ∂ I / ∂ y] T specifying ∇ the direction of greatest rate of change in intensity (i.e., perpendicular to the edge’s direction) u From gradient can determine the direction in which the first derivative is highest, and the magnitude of the first derivative in that direction u Magnitude = [( ∂ I / ∂ x) 2 + ( ∂ I / ∂ y) 2 ] 1/2 u Direction = tan -1 ( ∂ I / ∂ y)/( ∂ I / ∂ x) 23 Computing First Derivative l To compute first derivative in direction θ , calculate from linear combination of derivatives from any two non-collinear directions � x = x ′ cos θ - y ′ sin θ y = x ′ sin θ + y ′ cos θ y ′ y x ′ ∂ I / ∂ x ′ = ∂ I / ∂ x ∂ x/ ∂ x ′ + ∂ I / ∂ y ∂ y/ ∂ y ′ � = ∂ I / ∂ x cos θ + ∂ I / ∂ y sin θ θ ∂ I / ∂ y ′ = - ∂ I / ∂ x sin θ + ∂ I / ∂ y cos θ x � ( ∂ I / ∂ x ′ ) 2 + ( ∂ I / ∂ y ′ ) 2 = ( ∂ I / ∂ x) 2 + ( ∂ I / ∂ y) 2 � So, sum of squares of first derivative is isotropic, non-linear � Similarly, all derivatives of odd ordcr raised to an even power are isotropic 24 12

  13. Gradient l Gradient = [ ∂ I / ∂ x, ∂ I / ∂ y] T l What direction is first derivative a maximum? u Set ∂ / ∂θ ( ∂ I / ∂ x ′ ) = 0, and solve for θ ⇒ ∂ / ∂θ ( ∂ I / ∂ x cos θ + ∂ I / ∂ y sin θ ) = 0 ⇒ θ = tan -1 ( ∂ I / ∂ y / ∂ I / ∂ x) l Gradient direction is perpendicular to “edge direction” l Gradient magnitude is isotropic 2 ∂ 2  ∂    I I ∇ = +     I   ∂ ∂     x y 25 Edge Detection in 2D l With a digital image, the partial derivatives are replaced by finite differences: v u ∆ x I = I (u+1, v) - I (u, v) u u ∆ y I = I (u, v) - I (u, v+1) l An alternative (Sobel) u ∆ sobel_X I = I (u+1, v+1) + 2 I (u+1, v) + I (u+1, v-1) - I (u-1, v+1) - 2 I (u-1, v) - I (u-1, v-1) u ∆ sobel_Y I = I (u-1, v-1) + 2 I (u, v-1) + I (u+1, v-1) - I (u-1, v+1) - 2 I (u, v+1) - I (u+1, v+1) l Roberts’s “Cross” u ∆ + I = I (u, v) - I (u+1, v-1) 1 0 0 -1 u ∆ - I = I (u, v-1) - I (u+1, v) 0 -1 1 0 26 13

  14. Gradient Operator Example l I = 0 0 0 1 2 3 4 4 4 8 8 8 3 3 3 l ∆ x = -1 1 l ∆ x I = * 0 0 1 1 1 1 0 0 4 0 0 -5 0 0 27 14

  15. Directional Edge Operators l Kirsch 8-direction masks − − − 3 3 5 3 5 5 = − = − 3 0 5 k 3 0 5 k 1 0 − − − − − 3 3 3 3 3 5 − − − 5 5 5 3 3 3 = − − = − k 3 0 3 k 3 0 5 2 7 − − − − 3 3 3 3 5 5 l Gradient magnitude = max k n = n 0 ,... 7 l Gradient direction = 45° argmax k n 30 15

  16. Directional Edge Operators l Robinson masks − − − 1 0 1 2 1 0 = − = − r 2 0 2 r 1 0 1 0 7 − 1 0 1 0 1 2 l Nevatia and Babu used 6 5x5 masks, detecting orientations at multiples of 30° 31 Edge Detection in 2D l How do we combine the directional derivatives to compute the gradient magnitude? u Use the root mean square (RMS) as in the continuous case u Sum of the absolute values of the directional derivatives u Maximum of the absolute values of the directional derivatives l Advantages of the latter u Avoids computing square root (although this can be done using table lookups) u Keeps result in the same range as the original image u Gives a magnitude that is invariant with respect to orientation of the edge in the image ( ∆ sobel_X overestimates diagonal edges and ∆ + overestimates horizontal and vertical edge magnitudes) 32 16

  17. Finite Differences and Noise Finite difference filters respond What is to be done? l l strongly to noise u intuitively, most pixels in images look quite a lot like u obvious reason: image noise their neighbors results in pixels that look very different from their neighbors u this is true even at an edge; along the edge they’re similar, Generally, the larger the noise l across the edge they’re not the stronger the response u suggests that smoothing the image should help, by forcing pixels different from their neighbors (=noise pixels?) to look more like their neighbors 33 Finite Differences Responding to Noise Increasing noise -> (this is zero mean additive gaussian noise) 34 17

Recommend


More recommend