Linear Shift-Invariant Filtering in Computer Vision

cs 565 computer vision n.w
1 / 33
Embed
Share

Explore the concepts of linear shift-invariant filtering, derivative filtering, and the significance of derivative computation in computer vision. Discover how these filters are utilized to extract features like edges and corners from images, along with the precautions to take to avoid false edges due to noise amplification.

  • Computer Vision
  • Filtering Techniques
  • Derivatives
  • Image Processing
  • Edge Detection

Uploaded on | 2 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. CS 565 Computer Vision Nazar Khan Lecture 9

  2. Linear Shift-Invariant Filtering We have studied convolution in Lecture 4. Convolution is 1. Linear: ( f+ g)*w = f*w+ g*w for , in R. Convolution of linear combination equals linear combination of convolutions. 2. Shift-invariant: Tb(f*w) = Tbf*w for translation Tbin R. Translating the signal is equivalent to translating the convolution. 3. Commutative: f*w = w*f Signal and filter play an equal role. 4. Associative: (f*v)*w = f*(v*w) Successive convolutions with kernels v and w equal a single convolution by the kernel v*w. Any filter obeying properties 1 and 2 is called a Linear Shift-Invariant (LSI) filter.

  3. Derivative Filtering Derivative filters are an important special case of LSI filters. Derivatives capture local gray value image changes. Perceptually important features such as edges and corners. Derivative computation can be dangerous.

  4. Derivative Filtering Left: A road image for which two 1D signals along the red and blue horizontal scan-lines have been extracted. Right: The intensity profiles along the red and blue scan-lines. The large jumps in the profiles correspond to boundaries of trees and road. Author: Nazar Khan (2014)

  5. Derivative Filtering 1D signal Edge corresponds to maximum of 1st derivative magnitude. 1st Derivative Edge corresponds to zero-crossing of 2nd derivative. 2nd Derivative

  6. Derivative computation can be dangerous Noise can be amplified. This leads to false edges. Derivatives in spatial domain become multiplications with frequency in Fourier domain. High frequency (noise) components get amplified. ( ) ( ) uF i u u f = 2 F f u H.W.: Prove this. Solution: remove high frequencies before computing derivatives (often done through Gaussian convolution).

  7. Left: A 1D intensity profile. Right: Plot of the 2nd derivatives. The small preturbations (noise) in the input lead to false zero-crossings (edges) in 2nd derivatives. Author: Nazar Khan (2014)

  8. Average vs Derivative Filtering Derivative opposite signs Sum to zero Output on smooth region is zero Gives high output in areas of high contrast Larger mask -> more edges detected Average All values are +ve Sum to 1 Output on smooth region is unchanged Blurs areas of high contrast Larger mask -> more smoothing

  9. Some Notation From 2D Calculus Let f(x,y) be a 2D function. f/ x = xf = fxis the partial derivative of f with respect to x while keeping y fixed. 2f/ x y = / x ( f/ y) fxy=fyx (under suitable smoothness assumptions).

  10. Some Notation From 2D Calculus Nabla operator or gradient is the column vector of partial derivatives =( x, y). f=( xf, yf ) points in the direction of steepest ascent. | f|=sqrt(fx2+fy2) is invariant under rotations. Laplacian operator f = fxx+fyy Sum of 2nd derivatives

  11. Discrete Derivative Approximations Let h be the grid distance. For grids of image pixels, usually h=1. 1st derivative approximation Forward difference fi =(fi+1-fi )/h Backward difference fi =(fi-fi-1 )/h Central difference fi = (fi+1-fi-1)/2h 2nd derivative approximation Central difference fi = (fi+1-2fi+fi-1)/2h fi-1 fi fi+1

  12. Discrete Derivative Approximations Taking central differences is better. In 2D, use 2f/ x y = / x ( f/ y). Convolve in one direction, then convolve the result in the other. This way, we carry out 2D convolutions using 1D convolutions only.

  13. Discrete 2D Laplacian Approximation A standard approximation of the 2D Laplacian f = fxx+fyyis given by 0 1 0 1 2 , f h ( ) 1 = + + 2 4 1 4 1 ( ) f h f f h , , , i j i j xxxx i j yyyy i j 12 0 1 0 The true Laplacian is rotationally invariant but this discrete approximation is not.

  14. Discrete 2D Laplacian Approximation A better, rotationally invariant discrete approximation of the Laplacian is given by 1 4 1 ( ) 1 h 1 = + + + 2 4 4 20 4 2 ( ) f f h f f f h , , , , , i j i j xxxx i j xxyy i j yyyy i j 2 6 12 1 4 1

  15. Edge Detection Edge strong change in local neighbourhood. One of the most important image features. We can understand comics and line drawings. Edge detection is the first step from low-level vision (pixel based descriptors) towards high-level vision (image content). Can be detected through 1st or 2nd order derivative operators.

  16. Edge Detection via 1st Order Derivatives 1. Reduce high frequencies (noise) in image f by convolving with a Gaussian kernel K . Smooth image u= K *f. 2. Compute approximate 1st derivatives ux and uy and compute gradient magnitude | u|=sqrt(ux2+uy2) 3. Edge pixels correspond to | u|>T.

  17. Clockwise from top-left: Original image I, horizontal derivative image Ix, vertical derivative image Iy, gradient magnitude image | u|, | u|>5, | u|>10. Author: Nazar Khan (2014)

  18. Edge Detection via 1st Order Derivatives Advantage 1st order derivatives are more robust to noise than 2nd order derivatives. Disadvantages Require threshold parameter T. Some edges may be below T. Some edges may be too thick. Remarks Suitable T strongly depends on . Why? T can be selected as a suitable percentile of the histogram of | u|. T is the 75th percentile if | u|<T for 75% of the pixels.

  19. Canny Edge Detector Among the best performing edge detectors. Mainly due to sophisticated post-processing. 3 main steps. 3 parameters Standard deviation of Gaussian smoothing kernel. Two thresholds Tlow and Thigh.

  20. Canny Edge Detector 1. Gradient approximation by Gaussian derivatives Magnitude | u|=sqrt(ux2+uy2) Orientation angle =arg(| u|)=atan(ux,uy) | u|>Tlow are candidate edge pixels. 2. Non-maxima Suppression (thinning of edges to a width of 1 pixel) In every edge candidate, consider the grid direction (out of 4 directions) that is most orthogonal to the edge. Basic Idea: If one of the two neighbours in this direction has a larger gradient magnitude,mark the central pixel. After passing through all candidates, remove marked pixels from the edge map.

  21. Non-maxima Suppression Quantisation of gradient direction.

  22. Non-maxima Suppression Only this point remains. The remaining magnitudes along the line are set to 0. Remove all points along the gradient direction that are not maximum points.

  23. Gradient direction Original Gradient magnitude | u| Non-maxima suppression of | u| Quantized

  24. Canny Edge Detector 3. Hysteresis Thresholding (Double Thresholding): Basic Idea: If a weak edge lies adjacent to a strong edge, include the weak edge too. Use pixels above upper threshold Thigh as seed points for relevant edges. Recursively add all neighbours of seed points that are above the lower threshold Tlow.

  25. Hysteresis Thresholding Scan image from left to right, top to bottom If M(x,y) is above Thigh mark it as edge. Recursively look at neighbors; if gradient magnitude is above Tlow mark it as edge.

  26. Hysteresis Thresholding Gradient Magnitude High Low Neighbours

  27. Edge Detection via 2nd Order Derivatives Compute Laplacian of Gaussian (LoG) u = uxx+uyywhere u is a Gaussian smoothed image(u= K *f). Edges correspond to zero-crossings of the LoG u.

  28. Edge Detection via 2nd Order Derivatives Advantages Single pixel thick edges that form closed contours No additional parameters besides . Disadvantages 2nd order derivatives are more sensitive to noise than 1st order derivatives. Can give false edges.

Related


More Related Content