Open In App
Related Articles

Image Edge Detection Operators in Digital Image Processing

Like Article
Save Article
Report issue

Edges are significant local changes of intensity in a digital image. An edge can be defined as a set of connected pixels that forms a boundary between two disjoint regions. There are three types of edges: 

  • Horizontal edges
  • Vertical edges
  • Diagonal edges

Edge Detection is a method of segmenting an image into regions of discontinuity. It is a widely used technique in digital image processing like 

  • pattern recognition
  • image morphology
  • feature extraction

Edge detection allows users to observe the features of an image for a significant change in the gray level. This texture indicating the end of one region in the image and the beginning of another. It reduces the amount of data in an image and preserves the structural properties of an image. 

Edge Detection Operators are of two types: 

  • Gradient – based operator which computes first-order derivations in a digital image like, Sobel operator, Prewitt operator, Robert operator
  • Gaussian – based operator which computes second-order derivations in a digital image like, Canny edge detector, Laplacian of Gaussian 


Sobel Operator: It is a discrete differentiation operator. It computes the gradient approximation of image intensity function for image edge detection. At the pixels of an image, the Sobel operator produces either the normal to a vector or the corresponding gradient vector. It uses two 3 x 3 kernels or masks which are convolved with the input image to calculate the vertical and horizontal derivative approximations respectively – 

    \[M_{x}=\left[\begin{array}{ccc}-1 & 0 & 1 \\ -2 & 0 & 2 \\ -1 & 0 & 1\end{array}\right] \quad M_{y}=\left[\begin{array}{ccc}-1 & -2 & -1 \\ 0 & 0 & 0 \\ 1 & 2 & 1\end{array}\right]\]


  1. Simple and time efficient computation
  2. Very easy at searching for smooth edges


  1. Diagonal direction points are not preserved always
  2. Highly sensitive to noise
  3. Not very accurate in edge detection
  4. Detect with thick and rough edges does not give appropriate results

Prewitt Operator: This operator is almost similar to the sobel operator. It also detects vertical and horizontal edges of an image. It is one of the best ways to detect the orientation and magnitude of an image. It uses the kernels or masks – 

    \[M_{x}=\left[\begin{array}{ccc}-1 & 0 & 1 \\ -1 & 0 & 1 \\ -1 & 0 & 1\end{array}\right] \quad M_{y}=\left[\begin{array}{ccc}-1 & -1 & -1 \\ 0 & 0 & 0 \\ 1 & 1 & 1\end{array}\right]\]


  1. Good performance on detecting vertical and horizontal edges
  2. Best operator to detect the orientation of an image


  1. The magnitude of coefficient is fixed and cannot be changed
  2. Diagonal direction points are not preserved always

Robert Operator: This gradient-based operator computes the sum of squares of the differences between diagonally adjacent pixels in an image through discrete differentiation. Then the gradient approximation is made. It uses the following 2 x 2 kernels or masks – 

    \[M_{x}=\left[\begin{array}{ccc}1 & 0 \\ 0 & -1\end{array}\right] \quad M_{y}=\left[\begin{array}{ccc}0 & 1 \\ -1 & 0\end{array}\right]\]


  1. Detection of edges and orientation are very easy
  2. Diagonal direction points are preserved


  1. Very sensitive to noise
  2. Not very accurate in edge detection

Marr-Hildreth Operator or Laplacian of Gaussian (LoG): It is a gaussian-based operator which uses the Laplacian to take the second derivative of an image. This really works well when the transition of the grey level seems to be abrupt. It works on the zero-crossing method i.e when the second-order derivative crosses zero, then that particular location corresponds to a maximum level. It is called an edge location. Here the Gaussian operator reduces the noise and the Laplacian operator detects the sharp edges. 
The Gaussian function is defined by the formula: 

    \[G(x, y)=\frac{1}{\sqrt{2 \pi \sigma^{2}}} \exp -\left(\frac{x^{2}+y^{2}}{2 \sigma^{2}}\right)\]



is the standard deviation. 
And the LoG operator is computed from 

    \[\mathrm{LoG}=\frac{\partial^{2}}{\partial x^{2}} G(x, y)+\frac{\partial^{2}}{\partial y^{2}} G(x, y)=\frac{x^{2}+y^{2}-2 \sigma^{2}}{\sigma^{4}} \exp \left(-\frac{x^{2}+y^{2}}{2 \sigma^{2}}\right)\]


  1. Easy to detect edges and their various orientations
  2. There is fixed characteristics in all directions


  1. Very sensitive to noise
  2. The localization error may be severe at curved edges
  3. It generates noisy responses that do not correspond to edges, so-called “false edges”

Canny Operator: It is a gaussian-based operator in detecting edges. This operator is not susceptible to noise. It extracts image features without affecting or altering the feature. Canny edge detector have advanced algorithm derived from the previous work of Laplacian of Gaussian operator. It is widely used an optimal edge detection technique. It detects edges based on three criteria: 

  1. Low error rate 
  2. Edge points must be accurately localized 
  3. There should be just one single edge response

  1. It has good localization
  2. It extract image features without altering the features
  3. Less Sensitive to noise


  1. There is false zero crossing
  2. Complex computation and time consuming

Some Real-world Applications of Image Edge Detection: 

  • medical imaging, study of anatomical structure
  • locate an object in satellite images
  • automatic traffic controlling systems
  • face recognition, and fingerprint recognition


Last Updated : 17 May, 2020
Like Article
Save Article
Share your thoughts in the comments
Similar Reads