The Laplacian filter is used for detection of edges in an image. It highlights areas in which intensity changes rapidly producing a picture of all the edges in an image.

The Laplacian filter is a standard Laplacian of Gaussian convolution. This is a second derivative function designed to measure changes in intensity without being overly sensitive to noise. The function produces a peak at the start of the change in intensity and then at the end of the change.

Because the Laplacian of Gaussian produces a fairly wide convolution for a small radius this filter can become quite computationally expensive as radius is increased.



static void Laplacian(Bitmap bitmap, double radius);

[Visual Basic]

Shared Sub Laplacian(bitmap As Bitmap, radius As Double)
Name Description
bitmap The bitmap to process
radius This value represents the standard deviation of the Laplacian of Gaussian function. It determines the size of the edges that are detected.



[C#]using (Bitmap bm = (Bitmap)Bitmap.FromFile(Server.MapPath("rez/ryk-naves-4Q6kXLAKK_Y-unsplash.jpg"))) {
  Effects.Laplacian(bm, 0.8);
using (Bitmap bm = (Bitmap)Bitmap.FromFile(Server.MapPath("rez/ryk-naves-4Q6kXLAKK_Y-unsplash.jpg"))) {
  Effects.Laplacian(bm, 1.6);
using (Bitmap bm = (Bitmap)Bitmap.FromFile(Server.MapPath("rez/ryk-naves-4Q6kXLAKK_Y-unsplash.jpg"))) {
  Effects.Laplacian(bm, 3.2);

Here we apply a Laplacian edge detection filter using different radii. Ouput files are shown below.