topic 4 topic 4 local analysis of image local analysis of
play

Topic 4: Topic 4: Local analysis of image Local analysis of image - PowerPoint PPT Presentation

Topic 4: Topic 4: Local analysis of image Local analysis of image patches patches patches patches What do we mean by an image patch? What do we mean by an image patch? Applications of local image analysis


  1. Taylor Taylor- -Series Approximation of I(x) Series Approximation of I(x) But do we know the derivatives? But do we know the derivatives?

  2. Taylor Taylor- -Series Approximation of I(x) Series Approximation of I(x) But do we know the derivatives? But do we know the derivatives? No, but we can estimate them!

  3. Taylor Taylor- -Series Approximation of I(x) Series Approximation of I(x) And can we estimate them for the entire row? And can we estimate them for the entire row?

  4. Taylor Taylor- -Series Approximation of I(x) Series Approximation of I(x) And can we estimate them for the entire row? And can we estimate them for the entire row? Yes, but pixel by pixel. In fact…

  5. Applying the same operation on multiple patches Applying the same operation on multiple patches A “sliding A “sliding window” window” algorithm is a algorithm is a common approach to patch common approach to patch-based based operations operations The algorithm goes as follows: The algorithm goes as follows:

  6. Applying the same operation on multiple patches Applying the same operation on multiple patches A “sliding window” A “sliding window” algorithm is a algorithm is a common approach to patch common approach to patch-based based operations operations The algorithm goes as follows: The algorithm goes as follows: 1. 1. Define a “pixel window” using a Define a “pixel window” using a window size and a window center. window size and a window center.

  7. Applying the same operation on multiple patches Applying the same operation on multiple patches A “sliding A “sliding window” window” algorithm is a algorithm is a common approach to patch common approach to patch-based based operations operations The algorithm goes as follows: The algorithm goes as follows: 1. 1. Define a “pixel window” using a Define a “pixel window” using a window size and a window center. window size and a window center. 2. 2. 2. 2. Apply whatever operation in mind Apply whatever operation in mind Apply whatever operation in mind Apply whatever operation in mind to that patch to that patch 3. 3. Move the window center one pixel Move the window center one pixel to define a new window to define a new window 4. 4. Repeat steps 1 Repeat steps 1-3

  8. Applying the same operation on multiple patches Applying the same operation on multiple patches A “sliding A “sliding window” window” algorithm is a algorithm is a common approach to patch common approach to patch-based based operations operations The algorithm goes as follows: The algorithm goes as follows: 1. 1. Define a “pixel window” using a Define a “pixel window” using a window size and a window center. window size and a window center. 2. 2. 2. 2. Apply whatever operation in mind Apply whatever operation in mind Apply whatever operation in mind Apply whatever operation in mind to that patch to that patch 3. 3. Move the window center one pixel Move the window center one pixel to define a new window to define a new window 4. 4. Repeat steps 1 Repeat steps 1-3

  9. Applying the same operation on multiple patches Applying the same operation on multiple patches A “sliding A “sliding window” window” algorithm is a algorithm is a common approach to patch common approach to patch-based based operations operations The algorithm goes as follows: The algorithm goes as follows: 1. 1. Define a “pixel window” using a Define a “pixel window” using a window size and a window center. window size and a window center. 2. 2. 2. 2. Apply whatever operation in mind Apply whatever operation in mind Apply whatever operation in mind Apply whatever operation in mind to that patch to that patch 3. 3. Move the window center one pixel Move the window center one pixel to define a new window to define a new window 4. 4. Repeat steps 1 Repeat steps 1-3

  10. Applying the same operation on multiple patches Applying the same operation on multiple patches A “sliding A “sliding window” window” algorithm is a algorithm is a common approach to patch common approach to patch-based based operations operations The algorithm goes as follows: The algorithm goes as follows: 1. 1. Define a “pixel window” using a Define a “pixel window” using a window size and a window center. window size and a window center. 2. 2. 2. 2. Apply whatever operation in mind Apply whatever operation in mind Apply whatever operation in mind Apply whatever operation in mind to that patch to that patch 3. 3. Move the window center one pixel Move the window center one pixel to define a new window to define a new window 4. 4. Repeat steps 1 Repeat steps 1-3

  11. Applying the same operation on multiple patches Applying the same operation on multiple patches A “sliding A “sliding window” window” algorithm is a algorithm is a common approach to patch common approach to patch-based based operations operations The algorithm goes as follows: The algorithm goes as follows: 1. 1. Define a “pixel window” using a Define a “pixel window” using a window size and a window center. window size and a window center. 2. 2. 2. 2. Apply whatever operation in mind Apply whatever operation in mind Apply whatever operation in mind Apply whatever operation in mind to that patch to that patch 3. 3. Move the window center one pixel Move the window center one pixel to define a new window to define a new window 4. 4. Repeat steps 1 Repeat steps 1-3

  12. Estimating Derivatives For Image Row r Estimating Derivatives For Image Row r “Sliding window” algorithm: “Sliding window” algorithm: • Define a “pixel window” centered Define a “pixel window” centered at pixel ( at pixel (w,r w,r) ) • Fit n Fit n-degree poly to window’s degree poly to window’s intensities (usually n=1 or 2) intensities (usually n=1 or 2) • Assign the poly’s derivatives at x=0 Assign the poly’s derivatives at x=0 to pixel at window’s center to pixel at window’s center to pixel at window’s center to pixel at window’s center • “Slide” window one pixel over, so “Slide” window one pixel over, so that it is centered at pixel (w+1,r) that it is centered at pixel (w+1,r) • Repeat 1 Repeat 1-4 until window reaches 4 until window reaches right image border right image border

  13. Estimating Derivatives For Image Row r Estimating Derivatives For Image Row r “Sliding window” algorithm: “Sliding window” algorithm: • Define a “pixel window” centered Define a “pixel window” centered at pixel ( at pixel (w,r w,r) ) • Fit n Fit n-degree poly to window’s degree poly to window’s intensities (usually n=1 or 2) intensities (usually n=1 or 2) • Assign the poly’s derivatives at x=0 Assign the poly’s derivatives at x=0 to pixel at window’s center to pixel at window’s center to pixel at window’s center to pixel at window’s center • “Slide” window one pixel over, so “Slide” window one pixel over, so that it is centered at pixel (w+1,r) that it is centered at pixel (w+1,r) • Repeat 1 Repeat 1-4 until window reaches 4 until window reaches right image border right image border

  14. Estimating Derivatives For Image Row r Estimating Derivatives For Image Row r “Sliding window” algorithm: “Sliding window” algorithm: • Define a “pixel window” centered Define a “pixel window” centered at pixel ( at pixel (w,r w,r) ) • Fit n Fit n-degree poly to window’s degree poly to window’s intensities (usually n=1 or 2) intensities (usually n=1 or 2) • Assign the poly’s derivatives at x=0 Assign the poly’s derivatives at x=0 to pixel at window’s center to pixel at window’s center to pixel at window’s center to pixel at window’s center • “Slide” window one pixel over, so “Slide” window one pixel over, so that it is centered at pixel (w+1,r) that it is centered at pixel (w+1,r) • Repeat 1 Repeat 1-4 until window reaches 4 until window reaches right image border right image border

  15. Estimating Derivatives For Image Row r Estimating Derivatives For Image Row r “Sliding window” algorithm: “Sliding window” algorithm: • Define a “pixel window” centered Define a “pixel window” centered at pixel ( at pixel (w,r w,r) ) • Fit n Fit n-degree poly to window’s degree poly to window’s intensities (usually n=1 or 2) intensities (usually n=1 or 2) • Assign the poly’s derivatives at x=0 Assign the poly’s derivatives at x=0 to pixel at window’s center to pixel at window’s center to pixel at window’s center to pixel at window’s center • “Slide” window one pixel over, so “Slide” window one pixel over, so that it is centered at pixel (w+1,r) that it is centered at pixel (w+1,r) • Repeat 1 Repeat 1-4 until window reaches 4 until window reaches right image border right image border

  16. Estimating Derivatives For Image Row r Estimating Derivatives For Image Row r “Sliding window” algorithm: “Sliding window” algorithm: • Define a “pixel window” centered Define a “pixel window” centered at pixel ( at pixel (w,r w,r) ) • Fit n Fit n-degree poly to window’s degree poly to window’s intensities (usually n=1 or 2) intensities (usually n=1 or 2) • Assign the poly’s derivatives at x=0 Assign the poly’s derivatives at x=0 to pixel at window’s center to pixel at window’s center to pixel at window’s center to pixel at window’s center • “Slide” window one pixel over, so “Slide” window one pixel over, so that it is centered at pixel (w+1,r) that it is centered at pixel (w+1,r) • Repeat 1 Repeat 1-4 until window reaches 4 until window reaches right image border right image border

  17. Estimating Derivatives For Image Row r Estimating Derivatives For Image Row r “Sliding window” algorithm: “Sliding window” algorithm: • Define a “pixel window” centered Define a “pixel window” centered at pixel ( at pixel (w,r w,r) ) • Fit n Fit n-degree poly to window’s degree poly to window’s intensities (usually n=1 or 2) intensities (usually n=1 or 2) • Assign the poly’s derivatives at x=0 Assign the poly’s derivatives at x=0 to pixel at window’s center to pixel at window’s center to pixel at window’s center to pixel at window’s center • “Slide” window one pixel over, so “Slide” window one pixel over, so that it is centered at pixel (w+1,r) that it is centered at pixel (w+1,r) • Repeat 1 Repeat 1-4 until window reaches 4 until window reaches right image border right image border

  18. Topic 4.1: Topic 4.1: Local analysis of 1D image Local analysis of 1D image patches patches patches patches • • Taylor series approximation of 1D intensity patches Taylor series approximation of 1D intensity patches • • Estimating derivatives of 1D intensity patches: Estimating derivatives of 1D intensity patches: • • Least Least- -squares fitting squares fitting • Weighted least-squares fitting • Robust polynomial fitting: RANSAC

  19. Taylor Taylor- -Series Approximation of I(x) Series Approximation of I(x) As graph in 2D As graph in 2D How to estimate the Taylor series approximation from image data? image data?

  20. Taylor Taylor- -Series Approximation of I(x) Series Approximation of I(x) As graph in 2D As graph in 2D Surprise! The n th degree Taylor approximation can be approximation can be estimated using a linear system of equations (which we can represent in matrix form). This is Least Squares!

  21. Taylor Taylor- -Series Approximation of I(x) Series Approximation of I(x) We know that the As graph in 2D As graph in 2D Taylor series is:

  22. Taylor Taylor- -Series Approximation of I(x) Series Approximation of I(x) We know that the As graph in 2D As graph in 2D Taylor series is: The derivatives are unknown

  23. Taylor Taylor- -Series Approximation of I(x) Series Approximation of I(x) We know that the As graph in 2D As graph in 2D Taylor series is: But the coefficients are known

  24. Taylor Taylor- -Series Approximation of I(x) Series Approximation of I(x) The n-th order Taylor series As graph in 2D As graph in 2D expansion of I(x), near the patch center (x=0) can then be written in matrix form as:

  25. Taylor Taylor- -Series Approximation of I(x) Series Approximation of I(x) The n-th order Taylor series As graph in 2D As graph in 2D expansion of I(x), near the patch center (x=0) can then be written in matrix form as:

  26. Taylor Taylor- -Series Approximation of I(x) Series Approximation of I(x) The n-th order Taylor series As graph in 2D As graph in 2D expansion of I(x), near the patch center (x=0) can then be written in matrix form as: 2w+1 equations to estimate n+1 unknowns

  27. Least Least- -Squares Polynomial Fitting of I(x) Squares Polynomial Fitting of I(x) As graph in 2D As graph in 2D The equations define the system:

  28. Least Least- -Squares Polynomial Fitting of I(x) Squares Polynomial Fitting of I(x) We could then do v=Xd to get an estimate for all pixels in the patch in (-w, …, 0, …, w)

  29. Least Least- -Squares Polynomial Fitting of I(x) Squares Polynomial Fitting of I(x)

  30. 0 th th - -Order (Constant) Estimation of I(x) Order (Constant) Estimation of I(x)

  31. 0 th th - -Order (Constant) Estimation of I(x) Order (Constant) Estimation of I(x)

  32. 0 th th - -Order (Constant) Estimation of I(x) Order (Constant) Estimation of I(x)

  33. 0 th th - -Order (Constant) Estimation of I(x) Order (Constant) Estimation of I(x)

  34. 0 th th - -Order (Constant) Estimation of I(x) Order (Constant) Estimation of I(x)

  35. 0 th th - -Order (Constant) Estimation of I(x) Order (Constant) Estimation of I(x)

  36. 1 st st - -Order (Linear) Estimation of I(x) Order (Linear) Estimation of I(x)

  37. 2 nd nd - -Order (Quadratic) Estimation of I(x) Order (Quadratic) Estimation of I(x)

  38. 2 nd nd - -Order (Quadratic) Estimation of I(x) Order (Quadratic) Estimation of I(x) Note how all pixels in the window contribute equally to the estimate around the center of the window!

  39. Topic 4.1: Topic 4.1: Local analysis of 1D image Local analysis of 1D image patches patches patches patches • • Taylor series approximation of 1D intensity patches Taylor series approximation of 1D intensity patches • • Estimating derivatives of 1D intensity patches: Estimating derivatives of 1D intensity patches: • Least-squares fitting • • Weighted least Weighted least- -squares fitting squares fitting • Robust polynomial fitting: RANSAC

  40. Weighted Least Squares Polynomial Fitting Weighted Least Squares Polynomial Fitting Scenario #1: Scenario #1: • Fit polynomial to ALL pixel intensities in a patch Fit polynomial to ALL pixel intensities in a patch Intensity Intensity 0 Pixel (x) Pixel (x) -w w

  41. Weighted Least Squares Polynomial Fitting Weighted Least Squares Polynomial Fitting Scenario #2: Scenario #2: • Fit polynomial to Fit polynomial to all the pixel all the pixel intensities in intensities in the the patch patch • Pixels contribute to estimate of derivative(s) at Pixels contribute to estimate of derivative(s) at center according to a weight function Ω (x) center according to a weight function (x) Intensity Intensity 0 Pixel (x) Pixel (x) -w w

  42. Polynomial Fitting: A Linear Formulation Polynomial Fitting: A Linear Formulation

  43. Polynomial Fitting: A Linear Formulation Polynomial Fitting: A Linear Formulation

  44. Weighted Least Weighted Least- -Squares Estimation of I(x) Squares Estimation of I(x)

  45. Weighted Least Weighted Least- -Squares Estimation of I(x) Squares Estimation of I(x)

  46. Weighted Least Weighted Least- -Squares Estimation of I(x) Squares Estimation of I(x)

  47. Weighted Least Weighted Least- -Squares Estimation of I(x) Squares Estimation of I(x) We could then do v=Xd to get We could then do v=Xd to get an estimate of I(x) for all pixels in the patch in (-w, …, 0, …, w).

  48. Topic 4.1: Topic 4.1: Local analysis of 1D image Local analysis of 1D image patches patches patches patches • Taylor series approximation of 1D intensity patches • Taylor series approximation of 1D intensity patches • • Estimating derivatives of 1D intensity patches: Estimating derivatives of 1D intensity patches: • Least-squares fitting • Weighted least-squares fitting • • Robust polynomial fitting: RANSAC Robust polynomial fitting: RANSAC

  49. Robust Polynomial Fitting Robust Polynomial Fitting Scenario #3: Scenario #3: • Fit polynomial only to SOME pixel intensities in a patch Fit polynomial only to SOME pixel intensities in a patch (the “inliers”) (the “inliers”) Intensity Intensity -w w 0 Pixel (x) Pixel (x)

  50. Robust Polynomial Fitting Robust Polynomial Fitting But how can we tell between inliers and outliers? But how can we tell between inliers and outliers? Intensity Intensity w -w Pixel (x) Pixel (x)

  51. Robust Polynomial Fitting Robust Polynomial Fitting We can’t. At least not before we fit a model. We can’t. At least not before we fit a model.

  52. Polynomial Fitting Using RANSAC Polynomial Fitting Using RANSAC Here’s our problem: find the inliers, fit a polynomial to them: Here’s our problem: find the inliers, fit a polynomial to them: Given: Given: • n = degree of poly n = degree of poly • p = fraction of inliers p = fraction of inliers Intensity Intensity • t = fit threshold t = fit threshold • p = success probability • p s = success probability = success probability = success probability -w w 0 Pixel (x) Pixel (x)

  53. RANSAC Algorithm RANSAC Algorithm Example: Line fitting using RANSAC (i.e., n=2 unknown Example: Line fitting using RANSAC (i.e., n=2 unknown polynomial coefficients) polynomial coefficients) • Step 1: Randomly choose n pixels from the patch Step 1: Randomly choose n pixels from the patch Intensity Intensity -w w 0 Pixel (x) Pixel (x)

  54. RANSAC Algorithm RANSAC Algorithm Step Step 2: Fit the poly using the chosen pixels/intensities 2: Fit the poly using the chosen pixels/intensities Intensity Intensity -w w 0 Pixel (x) Pixel (x)

  55. RANSAC Algorithm RANSAC Algorithm Step Step 3: Count pixels with vertical distance < threshold t 3: Count pixels with vertical distance < threshold t -w w 0 Pixel (x) Pixel (x)

  56. RANSAC Algorithm RANSAC Algorithm • Step 4: If there aren’t “enough” such pixels, REPEAT Step 4: If there aren’t “enough” such pixels, REPEAT (not more than K times) (not more than K times) -w w 0 Pixel (x) Pixel (x)

  57. RANSAC Algorithm RANSAC Algorithm How about these two? How about these two? Intensity Intensity -w w 0 Pixel (x) Pixel (x)

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend