Presentation is loading. Please wait.

Presentation is loading. Please wait.

3-D Computer Vision CSc 83020 Feature Detection and Grouping.

Similar presentations


Presentation on theme: "3-D Computer Vision CSc 83020 Feature Detection and Grouping."— Presentation transcript:

1 3-D Computer Vision CSc 83020 Feature Detection and Grouping

2 CSc 83020 3-D Computer Vision – Ioannis Stamos Finding Corners

3 CSc 83020 3-D Computer Vision – Ioannis Stamos What Is a Corner? Large gradients in more than one direction.

4 CSc 83020 3-D Computer Vision – Ioannis Stamos A Simple Corner Detector Find eigenvalues of C If the smaller eigenvalue is above a threshold then we have a corner.

5 CSc 83020 3-D Computer Vision – Ioannis Stamos A Simple Corner Detector Find eigenvalues of C If the smaller eigenvalue is above a threshold then we have a corner.

6 CSc 83020 3-D Computer Vision – Ioannis Stamos A Simple Corner Detector

7 CSc 83020 3-D Computer Vision – Ioannis Stamos Sobel Operator -1 -2 -1 0 0 0 1 2 1 -1 0 1 -2 0 2 -1 0 1 S1=S1=S 2 = Edge Magnitude = Edge Direction = S 1 + S 2 2 2 tan -1 S1S1 S2S2

8 CSc 83020 3-D Computer Vision – Ioannis Stamos Sobel in Matlab

9 CSc 83020 3-D Computer Vision – Ioannis Stamos Canny Edge Detector

10 CSc 83020 3-D Computer Vision – Ioannis Stamos Comparison CannySobel

11 CSc 83020 3-D Computer Vision – Ioannis Stamos Canny Edge Detection Steps: Steps: 1. Apply derivative of Gaussian 2. Non-maximum suppression Thin multi-pixel wide “ridges” down to single pixel width Thin multi-pixel wide “ridges” down to single pixel width 3. Linking and thresholding Low, high edge-strength thresholds Low, high edge-strength thresholds Accept all edges over low threshold that are connected to edge over high threshold Accept all edges over low threshold that are connected to edge over high threshold

12 CSc 83020 3-D Computer Vision – Ioannis Stamos Non-Maximum Supression Non-maximum suppression: Select the single maximum point across the width of an edge.

13 CSc 83020 3-D Computer Vision – Ioannis Stamos Linking to the Next Edge Point Assume the marked point q is an edge point. Take the normal to the gradient at that point and use this to predict continuation points (either r or p).

14 CSc 83020 3-D Computer Vision – Ioannis Stamos Edge Hysteresis Hysteresis: A lag or momentum factor Hysteresis: A lag or momentum factor Idea: Maintain two thresholds k high and k low Idea: Maintain two thresholds k high and k low Use k high to find strong edges to start edge chain Use k high to find strong edges to start edge chain Use k low to find weak edges which continue edge chain Use k low to find weak edges which continue edge chain Typical ratio of thresholds is roughly Typical ratio of thresholds is roughly k high / k low = 2 k high / k low = 2

15 CSc 83020 3-D Computer Vision – Ioannis Stamos Canny Edge Detection (Example) courtesy of G. Loy gap is gone Original image Strong edges only Strong + connected weak edges Weak edges

16 CSc 83020 3-D Computer Vision – Ioannis Stamos Canny Edge Detection (Example) Using Matlab with default thresholds

17 CSc 83020 3-D Computer Vision – Ioannis Stamos Bridge Example Again edge(im,’canny’)

18 CSc 83020 3-D Computer Vision – Ioannis Stamos Summary: Canny Edge Detection Most commonly used method Most commonly used method Traces edges, accommodates variations in contrast Traces edges, accommodates variations in contrast Not a linear filter! Not a linear filter! Problems with corners Problems with corners

19 CSc 83020 3-D Computer Vision – Ioannis Stamos Towards Global Features Local versus global

20 CSc 83020 3-D Computer Vision – Ioannis Stamos From Edges to Lines

21 CSc 83020 3-D Computer Vision – Ioannis Stamos Finding Lines Assume edge detection Assume edge detection Each pixel is either edge or not Each pixel is either edge or not How do we find the line? How do we find the line?

22 CSc 83020 3-D Computer Vision – Ioannis Stamos Finding Lines Assume edge detection Assume edge detection Each pixel is either edge or not Each pixel is either edge or not How do we find the line? How do we find the line?

23 CSc 83020 3-D Computer Vision – Ioannis Stamos Least Squares Fitting of Lines Minimize E

24 CSc 83020 3-D Computer Vision – Ioannis Stamos Least Squares Fitting of Lines Minimize E Problem: E must be formulated carefully!

25 CSc 83020 3-D Computer Vision – Ioannis Stamos Least Squares Fitting of Lines Minimize E

26 CSc 83020 3-D Computer Vision – Ioannis Stamos Hough Transform y x

27 CSc 83020 3-D Computer Vision – Ioannis Stamos m Hough Transform: Quantization Detecting Lines by finding maxima / clustering in parameter space x y

28 CSc 83020 3-D Computer Vision – Ioannis Stamos Hough Transform: Algorithm For each image point, determine For each image point, determine most likely line parameters b,m (direction of gradient) most likely line parameters b,m (direction of gradient) strength (magnitude of gradient) strength (magnitude of gradient) Increment parameter counter by strength value Increment parameter counter by strength value Cluster in parameter space, pick local maxima Cluster in parameter space, pick local maxima

29 CSc 83020 3-D Computer Vision – Ioannis Stamos Hough Transform: Results Hough TransformImageEdge detection

30 CSc 83020 3-D Computer Vision – Ioannis Stamos Finding Lines Using the Hough Transform

31 CSc 83020 3-D Computer Vision – Ioannis StamosAlgorithm Discretize the parameter spaces ρ and θ. Discretize the parameter spaces ρ and θ. Create Accumulator array A(1..R,1..T). Create Accumulator array A(1..R,1..T). Set A(k,h)=0 for all k and h. Set A(k,h)=0 for all k and h. For each image edge E(i,j)=1 For each image edge E(i,j)=1 For h=1…T For h=1…T ρ =i cosθ d (h)+j sinθ d (h) ρ =i cosθ d (h)+j sinθ d (h) Find index k: ρ d is closest to ρ Find index k: ρ d is closest to ρ Increment A(h,k) by one. Increment A(h,k) by one. Find all local maxima (k p, h p ) such that A (k p, h p )>τ Find all local maxima (k p, h p ) such that A (k p, h p )>τ

32 CSc 83020 3-D Computer Vision – Ioannis Stamos Finding Lines Using the Hough Transform Strong local peaks correspond to lines.

33 CSc 83020 3-D Computer Vision – Ioannis Stamos Finding Lines Using the Hough Transform Resolution Issues …

34 CSc 83020 3-D Computer Vision – Ioannis Stamos From Forsyth and Ponce

35 CSc 83020 3-D Computer Vision – Ioannis Stamos Summary Hough Transform Smart counting Smart counting Local evidence for global features Local evidence for global features Organized in a table Organized in a table Careful with parameterization! Careful with parameterization! Problem: Curse of dimensionality Problem: Curse of dimensionality Works great for simple features with 3 unknowns Works great for simple features with 3 unknowns Will fail for complex objects Will fail for complex objects Problem: Not a local algorithm Problem: Not a local algorithm

36 CSc 83020 3-D Computer Vision – Ioannis Stamos Finding Circles by Hough Transform a0a0 b0b0 r (x i,y i ) Equation of Circle: x y

37 CSc 83020 3-D Computer Vision – Ioannis Stamos Finding Circles by Hough Transform a0a0 b0b0 r (x i,y i ) Equation of Circle: If radius r is known: x y x y a b (x i,y i ) Circles! Accumulator array A(a,b)

38 CSc 83020 3-D Computer Vision – Ioannis Stamos Finding Circles by Hough Transform a0a0 b0b0 r (x i,y i ) x y If r is not known Use accumulator array A(a,b,r) For each (x i,y i ) increment A(a,b,r) such that

39 CSc 83020 3-D Computer Vision – Ioannis Stamos Using Gradient Information Can save lot of computations! Given: location (x i,y i ) Edge direction φ i x y

40 CSc 83020 3-D Computer Vision – Ioannis Stamos Using Gradient Information Can save lot of computations! Given: location (x i,y i ) Edge direction φ i x y Assume r is known: x y φiφi (x i,y i ) a=x-rcosφ b=y-rsinφ Need to increment only one point in Accumulator Array. (a,b)

41 CSc 83020 3-D Computer Vision – Ioannis Stamos Hough Transform for Curves Curve y=f(x,a) Curve y=f(x,a) a=[a 1, …, a p ] the parameters of the curve. a=[a 1, …, a p ] the parameters of the curve. Limitation: size of parameter space wrt # of parameters. Limitation: size of parameter space wrt # of parameters. Solution: variable-resolution parameter space. Solution: variable-resolution parameter space.

42 CSc 83020 3-D Computer Vision – Ioannis Stamos Hough Transform Pattern Matching. Pattern Matching. More efficient than template matching. More efficient than template matching. Handles occlusion. Handles occlusion. Finds all instances of pattern. Finds all instances of pattern. Handling inaccurate edge locations? Handling inaccurate edge locations? Drawbacks? Drawbacks?


Download ppt "3-D Computer Vision CSc 83020 Feature Detection and Grouping."

Similar presentations


Ads by Google