laplacian of gaussian opencv

As Laplace operator may detect edges as well as noise (isolated, out-of-range), it may be desirable to smooth the image first by a convolution with a Gaussian kernel of width laplacian of gaussian opencv 

laplacian of gaussian opencv

to suppress the noise before using Laplace for edge detection: 

laplacian of gaussian opencv

The first equal sign is due to the fact that 

laplacian of gaussian opencv

So we can obtain the Laplacian of Gaussian laplacian of gaussian opencv first and then convolve it with the input image. To do so, first consider 

laplacian of gaussian opencv

and 

laplacian of gaussian opencv

Note that for simplicity we omitted the normalizing coefficient laplacian of gaussian opencv. Similarly we can get 

laplacian of gaussian opencv

Now we have LoG as an operator or convolution kernel defined as 

laplacian of gaussian opencv

The Gaussian laplacian of gaussian opencv and its first and second derivatives laplacian of gaussian opencv and laplacian of gaussian opencv are shown here:

laplacian of gaussian opencv

laplacian of gaussian opencv

This 2-D LoG can be approximated by a 5 by 5 convolution kernel such as 

laplacian of gaussian opencv

The kernel of any other sizes can be obtained by approximating the continuous expression of LoG given above. However, make sure that the sum (or average) of all elements of the kernel has to be zero (similar to the Laplace kernel) so that the convolution result of a homogeneous regions is always zero.

The edges in the image can be obtained by these steps:

  • Applying LoG to the image
  • Detection of zero-crossings in the image
  • Threshold the zero-crossings to keep only those strong ones (large difference between the positive maximum and the negative minimum)
The last step is needed to suppress the weak zero-crossings most likely caused by noise.

laplacian of gaussian opencv

转自:http://fourier.eng.hmc.edu/e161/lectures/gradient/node8.html