computer vision
play

Computer Vision Advanced Edge Detectors Prof. Flvio Cardeal - PowerPoint PPT Presentation

Computer Vision Advanced Edge Detectors Prof. Flvio Cardeal DECOM / CEFET-MG cardeal@decom.cefetmg.br Abstract This lecture discusses advanced edge detectors that combine multiple approaches


  1. Computer Vision Advanced Edge Detectors Prof. ¡Flávio ¡Cardeal ¡– ¡DECOM ¡/ ¡CEFET-­‑MG ¡ cardeal@decom.cefetmg.br ¡ ¡

  2. Abstract • This lecture discusses advanced edge detectors that combine multiple approaches into a single algorithm. 2 ¡

  3. LoG and DoG • The Laplacian of Gaussian (LoG) and the difference of Gaussians (DoG) are very important basic image transforms. • They are applied in several different domains in computer vision. 3 ¡

  4. LoG Edge Detector • Applying the Laplacian for a Gauss-filtered image can be done in one step of convolution, based on the theorem: ∇ 2 (G σ ∗ I) = I ∗ ∇ 2 G σ Note that for calculating the Laplacian of a Gauss-filtered image, we only have to perform one convolution with . ∇ 2 G σ 4 ¡

  5. LoG Edge Detector • The filter kernel for is not limited to be a 3 x 3 ∇ 2 G σ kernel as shown below: • In fact, because the Gauss function is continuous, we can calculate its exact Laplacian. How? 5 ¡

  6. LoG Edge Detector x • For the first partial derivative with respect to , we = = obtain that − x 2 + y 2 2 σ 2 · e − y 2 π s · e − x 2 � � 1 = 1 2 σ 2 G σ (x,y) = 2 πσ 2 exp 2 σ 2 ∂ G σ x 2 πσ 4 e − (x 2 + y 2 )/ 2 σ 2 ∂ x (x,y) = − 6 ¡

  7. LoG Edge Detector x y • We then repeat the derivative for and and obtain the LoG as follows: � x 2 + y 2 − 2 σ 2 � 1 e − (x 2 + y 2 )/ 2 σ 2 ∇ 2 G σ (x,y) = 2 πσ 4 σ 2 • The LoG is also known as the Mexican hat function. In fact, it is an “ inverted Mexican hat ”. The zero- crossings define the edges. 7 ¡

  8. LoG Edge Detector Source: ¡R. ¡KleKe ¡ 8 ¡

  9. Sampling the LoG Kernel • Let’s sample this Laplacian into a (2 k + 1) × (2 k + 1) filter kernel for an appropriate value of . k • But what is an appropriate value for ? k • We start with estimating the standard deviation σ for the given class of input images, and an appropriate value of follows from this. k 9 ¡

  10. Sampling the LoG Kernel • By doing and, for example, , we ∇ 2 G σ ( x , y ) = 0 y = 0 have both zero-crossings in the x axis as the roots x 2 = 2 σ 2 of , that is: x 1 = − σ 2 x 2 = + σ 2 • Consider a parameter given by: w w = x 1 − x 2 = 2 σ 2 10 ¡

  11. Parameter w Source: ¡R. ¡KleKe ¡ 11 ¡

  12. Sampling the LoG Kernel • For representing the Mexican hat function properly by samples, it is proposed to use a window size of . 3 w × 3 w = 6 σ 2 × 6 σ 2 • In conclusion, we have that: √ √ 2 σ � × ceil � 6 2 k + 1 × 2 k + 1 = ceil � 6 2 σ � Smallest integer equal to or larger than the argument 12 ¡

  13. Sampling the LoG Kernel • The value of needs to be estimated for the given σ image data. • Smoothing an image with a very “narrow” (i.e. ) σ < 1 Gauss function does not make much sense. • So, let us consider . The smallest kernel ( , σ ≥ 1 σ = 1 thus 3 = 8.485) will be of size 9 x 9 (i.e., = 4). w k 13 ¡

  14. LoG Scale Space σ = 0.5 σ = 1 Consider again this Gaussian σ = 2 σ = 4 scale space with six layers. Source: ¡R. ¡KleKe ¡ σ = 8 σ = 16 14 ¡

  15. LoG Scale Space σ = 0.5 σ = 1 So, here we have the resulting images σ = 2 σ = 4 after computing the Laplacians of those six layers. Source: ¡R. ¡KleKe ¡ σ = 8 σ = 16 15 ¡

  16. LoG Scale Space • This is an example of a LoG scale space. • As in a Gaussian scale space, each layer is defined by the scale , the used standard deviation in the σ Gauss function. • We can generate subsequent layers when starting at an initial scale and using subsequent scales σ a n ⋅ σ for and . a > 1 n = 0,1,..., m 16 ¡

  17. Difference of Gaussians (DoG) • The difference of Gaussians (DoG) operator is a common approximation of the LoG operator, justified by reduced run time. • Consider again the equation below, which defines a centered (i.e. zero-mean) Gauss function : G σ − x 2 + y 2 � � 1 2 πσ 2 exp G σ (x,y) = 2 σ 2 17 ¡

  18. Difference of Gaussians (DoG) • The DoG is defined by an initial scale and a σ scaling factor as follows: a > 1 D σ ,a (x,y) = L(x,y, σ ) − L(x,y,a σ ) • So, it is the difference between a blurred copy of image and an even more blurred copy of . I I 18 ¡

  19. Difference of Gaussians (DoG) • As for LoG, edges (following the step-edge model) are detected at zero-crossings. • Why DoG is an approximation of LoG? Because: ∇ 2 G σ (x,y) ≈ G a σ (x,y) − G σ (x,y) (a − 1 ) σ 2 with as a recommended parameter. a = 1.6 19 ¡

  20. DoG Scale Space • Different scales produce layers in the DoG σ D σ , a scale space. • Let’s see the next figure for a comparison of three layers in the DoG scale space. • The scaling factor used is: . a = 1.6 20 ¡

  21. DoG Scale Space Source: ¡R. ¡KleKe ¡ LoG DoG σ = 0.5 σ = 0.5 a = 1.6 21 ¡

  22. DoG Scale Space Source: ¡R. ¡KleKe ¡ a = (1.6) 3 LoG DoG σ = 0.5 σ = 0.5 22 ¡

  23. DoG Scale Space Source: ¡R. ¡KleKe ¡ a = (1.6) 5 LoG DoG σ = 0.5 σ = 0.5 23 ¡

  24. Embedded Confidence • A confidence measure is quantified information derived from calculated data, to be used for deciding about the existence of a particular feature . • If the calculated data match the underlying model of the feature detector reasonably well, then this should correspond to high values of the measure . 24 ¡

  25. The Meer-Georgescu Algorithm • The Meer-Georgescu algorithm detects edges while applying a confidence measure based on the assumption of the validity of the step-edge model. • Four parameters are considered in this method. 25 ¡

  26. The Meer-Georgescu Algorithm • Specifically, for a gradient vector g ( p ) = ∇ I ( x , y ) at a pixel location , those parameters are: p = ( x , y ) g ( p ) = g ( p ) 2 1. The estimated gradient magnitude ; 2. The estimated gradient direction ; θ ( p ) 3. An edge confidence value ; η ( p ) 4. The percentile of the cumulative gradient ρ k magnitude distribution. 26 ¡

  27. Computing the Gradient (2 k + 1) × (2 k + 1) • Let be a matrix representation of a A window centered at the current pixel location in p input image . I Τ • Moreover, let: be a (2 k + 1) × (2 k + 1) W = sd matrix of weights, obtained as the product of two vectors and . s = [ s 1 ,..., s 2 k + 1 ] d = [ d 1 ,..., d 2 k + 1 ] 27 ¡

  28. Computing the Gradient • Vectors and meet the following requirements: d s 1. Both are unit vectors in the L1-norm, i.e. and ; d 1 + ... d 2 k + 1 = 1 s 1 + ... s 2 k + 1 = 1 2. is an asymmetric vector, i.e. , d d 1 = − d 2 k + 1 , … , . d 2 = − d 2 k d k + 1 = 0 s s 1 = s 2 k + 1 ≤ ... 3. is a symmetric vector, i. e. . ≤ s 2 = s 2 k ≤ .... ≤ s k + 1 28 ¡

  29. Computing the Gradient • For example, the vectors and below define a 5 x s d 5 matrix : W d = [ − 0.125, -0.25, 0, 0.25, 0.125] Τ s = [0.0625, 0.25, 0.375, 0.25, 0.0625] Τ " % -0.0078 -0.0156 0 0.0156 0.0078 $ ' -0.0312 -0.0625 0 0.0625 0.0312 $ ' W = sd Τ = $ ' -0.0469 -0.0938 0 0.0938 0.0469 $ ' -0.0312 -0.0625 0 0.0625 0.0312 $ ' $ ' -0.0078 -0.0156 0 0.0156 0.0078 # & 29 ¡

  30. Computing the Gradient • Let be the i- th row of matrix . By using: a i A sd ⊤ A � � d 1 = Tr ( WA ) = Tr 2 k + 1 � W ⊤ A = s ⊤ Ad = d ⊤ a i � � � � d 2 = Tr s i i = 1 we obtain the first two parameters used in the algorithm: � d 1 � � d 2 1 + d 2 θ (p) = arctan g(p) = 2 d 2 30 ¡

  31. Generating the ρη Diagram • Let be a matrix representing (2 k + 1) × (2 k + 1) A ideal a template of an ideal step edge having the gradient direction . θ ( p ) A ideal • The value specifies the proposed Τ η ( p ) = Tr( A ideal A ) confidence measure. 31 ¡

  32. Generating the ρη Diagram • The values in and are normalized such A ideal A that , with in case of a perfect η ( p ) = 1 0 ≤ η ( p ) ≤ 1 match with the ideal step edge. • Let be the ordered list of g 1 < ... < g k < ... < g N distinct (rounded) gradient-magnitudes in image , I with cumulative distribution values (probabilities): [ ] ρ k = Prob g ≤ g k for 1 ≤ k ≤ N . F 32 ¡ magnitude

  33. Generating the ρη Diagram • For a given pixel in , assume that is the closest g k I real to its edge magnitude ; then we have the g ( p ) percentile . ρ ( p ) = ρ k • Altogether, for each pixel , we have a percentile p and a confidence between 0 and 1. ρ ( p ) η ( p ) 33 ¡

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