Presentation is loading. Please wait.

Presentation is loading. Please wait.

Finding Boundaries Computer Vision CS 143, Brown James Hays 09/28/11 Many slides from Lana Lazebnik, Steve Seitz, David Forsyth, David Lowe, Fei-Fei Li,

Similar presentations


Presentation on theme: "Finding Boundaries Computer Vision CS 143, Brown James Hays 09/28/11 Many slides from Lana Lazebnik, Steve Seitz, David Forsyth, David Lowe, Fei-Fei Li,"— Presentation transcript:

1 Finding Boundaries Computer Vision CS 143, Brown James Hays 09/28/11 Many slides from Lana Lazebnik, Steve Seitz, David Forsyth, David Lowe, Fei-Fei Li, and Derek Hoiem

2 Edge detection Goal: Identify sudden changes (discontinuities) in an image – Intuitively, most semantic and shape information from the image can be encoded in the edges – More compact than pixels Ideal: artist’s line drawing (but artist is also using object-level knowledge) Source: D. Lowe

3 Why do we care about edges? Extract information, recognize objects Recover geometry and viewpoint Vanishing point Vanishing line Vanishing point Vertical vanishing point (at infinity)

4 Origin of Edges Edges are caused by a variety of factors depth discontinuity surface color discontinuity illumination discontinuity surface normal discontinuity Source: Steve Seitz

5 Closeup of edges Source: D. Hoiem

6 Closeup of edges Source: D. Hoiem

7 Closeup of edges Source: D. Hoiem

8 Closeup of edges Source: D. Hoiem

9 Characterizing edges An edge is a place of rapid change in the image intensity function image intensity function (along horizontal scanline) first derivative edges correspond to extrema of derivative

10 Intensity profile Source: D. Hoiem

11 With a little Gaussian noise Gradient Source: D. Hoiem

12 Effects of noise Consider a single row or column of the image – Plotting intensity as a function of position gives a signal Where is the edge? Source: S. Seitz

13 Effects of noise Difference filters respond strongly to noise – Image noise results in pixels that look very different from their neighbors – Generally, the larger the noise the stronger the response What can we do about it? Source: D. Forsyth

14 Solution: smooth first To find edges, look for peaks in f g f * g Source: S. Seitz

15 Differentiation is convolution, and convolution is associative: This saves us one operation: Derivative theorem of convolution f Source: S. Seitz

16 Derivative of Gaussian filter * [1 -1] =

17 Smoothed derivative removes noise, but blurs edge. Also finds edges at different “scales”. 1 pixel3 pixels7 pixels Tradeoff between smoothing and localization Source: D. Forsyth

18 The gradient magnitude is large along a thick “trail” or “ridge,” so how do we identify the actual edge points? How do we link the edge points to form curves? Implementation issues Source: D. Forsyth

19 Designing an edge detector Criteria for a good edge detector: – Good detection: the optimal detector should find all real edges, ignoring noise or other artifacts – Good localization the edges detected must be as close as possible to the true edges the detector must return one point only for each true edge point Cues of edge detection – Differences in color, intensity, or texture across the boundary – Continuity and closure – High-level knowledge Source: L. Fei-Fei

20 Canny edge detector This is probably the most widely used edge detector in computer vision Theoretical model: step-edges corrupted by additive Gaussian noise Canny has shown that the first derivative of the Gaussian closely approximates the operator that optimizes the product of signal-to-noise ratio and localization J. Canny, A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8:679-714, 1986.A Computational Approach To Edge Detection Source: L. Fei-Fei

21 Note about Matlab’s Canny detector Small errors in implementation – Gaussian function not properly normalized – First filters with a Gaussian, then a difference of Gaussian (equivalent to filtering with a larger Gaussian and taking difference)

22 Example original image (Lena)

23 Derivative of Gaussian filter x-direction y-direction

24 Compute Gradients (DoG) X-Derivative of GaussianY-Derivative of GaussianGradient Magnitude

25 Get Orientation at Each Pixel Threshold at minimum level Get orientation theta = atan2(gy, gx)

26 Non-maximum suppression for each orientation At q, we have a maximum if the value is larger than those at both p and at r. Interpolate to get these values. Source: D. Forsyth

27 Assume the marked point is an edge point. Then we construct the tangent to the edge curve (which is normal to the gradient at that point) and use this to predict the next points (here either r or s). Edge linking Source: D. Forsyth

28 Before Non-max Suppression

29 After non-max suppression

30 Before Non-max Suppression

31 After non-max suppression

32 Hysteresis thresholding Threshold at low/high levels to get weak/strong edge pixels Do connected components, starting from strong edge pixels

33 Hysteresis thresholding Check that maximum value of gradient value is sufficiently large – drop-outs? use hysteresis use a high threshold to start edge curves and a low threshold to continue them. Source: S. Seitz

34 Final Canny Edges

35 Canny edge detector 1.Filter image with x, y derivatives of Gaussian 2.Find magnitude and orientation of gradient 3.Non-maximum suppression: – Thin multi-pixel wide “ridges” down to single pixel width 4.Thresholding and linking (hysteresis): – Define two thresholds: low and high – Use the high threshold to start edge curves and the low threshold to continue them MATLAB: edge(image, ‘canny’) Source: D. Lowe, L. Fei-Fei

36 Effect of  (Gaussian kernel spread/size) Canny with original The choice of  depends on desired behavior large  detects large scale edges small  detects fine features Source: S. Seitz

37 Learning to detect boundaries Berkeley segmentation database: http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/ http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/ image human segmentation gradient magnitude

38 Representing Texture Source: Forsyth

39 Texture and Material http://www-cvr.ai.uiuc.edu/ponce_grp/data/texture_database/samples/

40 Texture and Orientation http://www-cvr.ai.uiuc.edu/ponce_grp/data/texture_database/samples/

41 Texture and Scale http://www-cvr.ai.uiuc.edu/ponce_grp/data/texture_database/samples/

42 What is texture? Regular or stochastic patterns caused by bumps, grooves, and/or markings

43 How can we represent texture? Compute responses of blobs and edges at various orientations and scales

44 Overcomplete representation: filter banks LM Filter Bank Code for filter banks: www.robots.ox.ac.uk/~vgg/research/texclass/filters.html

45 Filter banks Process image with each filter and keep responses (or squared/abs responses)

46 How can we represent texture? Measure responses of blobs and edges at various orientations and scales Idea 1: Record simple statistics (e.g., mean, std.) of absolute filter responses

47 Can you match the texture to the response? Mean abs responses Filters A B C 1 2 3

48 Representing texture Idea 2: take vectors of filter responses at each pixel and cluster them, then take histograms.

49 Building Visual Dictionaries 1.Sample patches from a database – E.g., 128 dimensional SIFT vectors 2.Cluster the patches – Cluster centers are the dictionary 3.Assign a codeword (number) to each new patch, according to the nearest cluster

50 pB boundary detector Figure from Fowlkes Martin, Fowlkes, Malik 2004: Learning to Detect Natural Boundaries… http://www.eecs.berkeley.edu/Research/Projects/C S/vision/grouping/papers/mfm-pami-boundary.pdf

51 pB Boundary Detector Figure from Fowlkes

52 Brightness Color Texture Combined Human

53 Global pB boundary detector Figure from Fowlkes

54 45 years of boundary detection Source: Arbelaez, Maire, Fowlkes, and Malik. TPAMI 2011 (pdf)

55 Questions


Download ppt "Finding Boundaries Computer Vision CS 143, Brown James Hays 09/28/11 Many slides from Lana Lazebnik, Steve Seitz, David Forsyth, David Lowe, Fei-Fei Li,"

Similar presentations


Ads by Google