Edge Detection Using Laplacian | Edge Detection

Edge Detection Using Laplacian | Edge Detection

Introduction to Laplacian Operator

In this section, we will learn about the Laplacian operator and how it can be used to detect edges in an image.

Second Derivative of an Image

  • The second derivative of an image can be used to detect edges.
  • At the edges, you do not get peaks but very strong zero-crossings.
  • If you can detect the zero-crossings, wherever there is a zero-crossing, you have an edge.

Laplacian Operator

  • The Laplacian operator is called the Del squared operator.
  • It is nothing but the sum of the second derivative of the image with respect to x and y.
  • When you apply the Laplacian operator to an image, you're going to end up with zero-crossings, and that's where the edges lie.

Implementing a Laplacian Operator for Discrete Images

  • The Laplacian operator uses finite differences which are differences of differences.
  • To find the difference of differences, at least 3 pixels are needed.
  • A 3x3 operator is used for discrete images.

Problem with Laplacian Operator

  • Edges can appear in any orientation but we have only found second derivatives with respect to x and y.
  • We need to account for diagonal direction as well since we are on a square grid but edges can appear in any orientation.

Edge Detection and Noise

In this section, we learn about edge detection and how noise can affect it. We also learn about different techniques to mitigate the effect of noise.

Edge Detection

  • An image cannot be negative, so we make 128 equal to 0 in an 8-bit image.
  • Things darker than 128 are negative, while things brighter than 128 are positive.
  • Zero-crossings are detected to give the final edge map.

Noise Mitigation

  • Noise is a problem in edge detection because it interferes with rapid changes.
  • Gaussian smoothing can be used to suppress noise before applying edge detection.
  • The first derivative of the signal with respect to x can be applied after smoothing for better results.
  • A Laplacian of Gaussian operator can also be used for noise suppression before applying the Laplacian operator.

Gradient Operator vs. Laplacian Operator

  • The Gradient operator uses two operators convolved with the image to calculate strength and orientation of edges at each pixel.
  • The Laplacian operator applies a single function obtained by applying the Laplacian to a Gaussian.

The Laplacian and Gradient Operators

This section discusses the differences between the Laplacian and Gradient operators for edge detection.

Differences between Laplacian and Gradient Operators

  • The Laplacian operator locates edges by identifying zero-crossings, while the Gradient operator requires thresholding to determine strong-enough edges.
  • A simple measure can be used to identify zero-crossings in the Laplacian operator, whereas the Gradient operator requires two convolutions and a nonlinear operation to find magnitude and orientation.
  • The Laplacian is a linear operation that uses a single convolutional, while the Gradient operator is nonlinear.

Canny Edge Detector

This section introduces the Canny edge detector as an improved method for edge detection.

Introduction to Canny Edge Detector

  • The Canny edge detector combines the best attributes of both the Laplacian and Gradient operators into a single operator that works even better than either one alone.
Video description

First Principles of Computer Vision is a lecture series presented by Shree Nayar who is faculty in the Computer Science Department, School of Engineering and Applied Sciences, Columbia University. Computer Vision is the enterprise of building machines that “see.” This series focuses on the physical and mathematical underpinnings of vision and has been designed for students, practitioners, and enthusiasts who have no prior knowledge of computer vision.