FuJian Normal University • the most common approach for detecting meaningful discontinuities in gray level. • we discuss approaches for implementing – first-order derivative (Gradient operator) – second-order derivative (Laplacian operator) • Here, we will talk only about their properties for edge detection.

Faculty of Software Digital Image Processing FuJian Normal University What is Edge? Edges often occur at points where there is a large variation in the luminance values in an image, and consequently they often indicate the edges, or occluding boundaries, of the objects in a scene. .

Faculty of Software Digital Image Processing

What is Image Edge?

FuJian Normal Edge Types University An edge point can be regarded as a point in an image where a discontinuity (in gradient) occurs across some line. A discontinuity may be classified as one of five types .

Faculty of Software Digital Image Processing What is Image Edge?

FuJian Normal University

because of optics, ampling, image acquisition imperfection Faculty of Software Digital Image Processing

What is Image Edge?

FuJian Normal Edge Descriptors University

Edge direction: Tangent to the contour of the edge Edge Normal: Direction of maximum intensity variation at the edge point Edge Position: The image position at which the edge is located Edge Strength: Measure of local contrast across the edge

Faculty of Software Digital Image Processing

What is Image Edge?

FuJian Normal University Edge Detection Operators

Based on the idea that edge information in an image, is found by looking at the relationship between a pixel and its neighbours. i.e. edge is found by discontinuity of grey level values. An ideal edge detector should produce an edge indication localised to a single pixel located at the mid- point of the slope.

Faculty of Software Digital Image Processing Edge Detection:Derivative Operators

FuJian Normal University 2 major classes of differential edge detection 1. First order derivative Some form of spatial first order differentiation is performed, and the resulting gradient is compared to a threshold value. An edge is judged present if the gradient exceeds the threshold. 2. Second order derivative An edge is judged present if there is a significant spatial change in the polarity of the second derivative.

Faculty of Software Digital Image Processing

Edge Detection:Derivative Operators

FuJian Normal University

Edges are located at * Maxima of absolute value of first derivative * zero-crossings of second derivative

Faculty of Software Digital Image Processing

Edge Detection:Derivative Operators

FuJian Normal University

Original image

Gray-levels of image

First derivative of gray-level +ve at leading edge of transition -ve at trailing edge of transition i.e.magnitude can detect presence of edge Second derivative of gray-level +ve for dark side of edge -ve for light side of edge

Faculty of Software Digital Image Processing Edge Detection:Derivative Operators

FuJian Normal University

the signs of the derivatives would be reversed for an edge that transitions from light to dark

Faculty of Software Digital Image Processing Edge Detection:Derivative Operators

FuJian Normal University

Faculty of Software Digital Image Processing Edge Detection:Gradient Operators

FuJian Normal University The first derivative at any point in an image is obtained by using the magnitude of the gradient at that point. A change of the image function can be described by a gradient that points in the direction of the largest growth of the image function. Many are implemented with masks.

Faculty of Software Digital Image Processing Gradient based methods

FuJian Normal University The gradient is a vector, whose components measure how rapidly pixel values are changing with distance in the x and y directions.

The gradient points in the direction of most rapid change in intensity and

Faculty of Software Digital Image Processing FuJian Normal University Thus, the components of the gradient may be found using the following approximation:

and measure distance along the x and y directions respectively.

Faculty of Software Digital Image Processing Gradient based methods

FuJian Normal University

In order to detect the presence of a gradient discontinuity we must calculate the change in gradient at (i,j). We can do this by finding the following gradient magnitude measure,

gradient direction,

Faculty of Software Digital Image Processing Implementation

FuJian Normal University The difference operators correspond to convolving the image with the two masks.

Edge operator convolution masks

Faculty of Software Digital Image Processing Example

FuJian Normal University

x directions

Gradient y directions directions

Faculty of Software Digital Image Processing Edge Detection Operator

 Roberts Operator   Prewitt Operator  Kirsh Compass Mask  Robinson Compass Mask  Laplacian Operator  Frei-Chen Mask

3 edge operator

FuJian Normal University abc 1 0 0 1 d e f * ⎡ ⎤ + ⎡ ⎤ ⎢ ⎥ ⎢0 −1⎥ ⎣−1 0⎦ g h i ⎣ ⎦

Image(x,y)

|e*1+f*0+h*0-i*1|+|e*0+f*1-h*1+0*i|=|e-i|+|f-h|

Faculty of Software Digital Image Processing Robert edge operator Example

FuJian Normal University

Faculty of Software Digital Image Processing Robert edge operator Example

FuJian Normal University

Faculty of Software Digital Image Processing Roberts Cross edge operator

FuJian Normal University Instead of finding approximate gradient components along the x and y directions we can also approximate gradient components along directions at 45 and 135 to the axes respectively. In this case the following equations are used:

This form of operator is known as the Roberts edge operator and was one of the first operators used to detect edges in images. The corresponding convolution masks are given by:

Faculty of Software Digital Image Processing Roberts Operator

4

Sobel edge operator

FuJian Normal University abc

d e f

g h i

Image(x,y)

with 3*3 neighbourhood

∇f =| (g + h + i) − (a + b + c) | + | (c + f + i) − (a + d + g) |

Faculty of Software Digital Image Processing Sobel edge operator

FuJian Normal University

Faculty of Software Digital Image Processing Sobel edge operator

FuJian Normal University The Sobel edge operator masks are

Faculty of Software Digital Image Processing Sobel Operator

5 Sobel edge operator

FuJian Normal University

SobelX

SobelY Sobel

Faculty of Software Digital Image Processing Prewitt edge operator

FuJian Normal University The Prewitt operator, similarly to the Sobel, Kirsch, Robinson and some other operators, approximates the first derivative.

The gradient is estimated in eight(for a convolution mask)possible directions.

The convolution result of the greatest magnitude indicates the gradient magnitude.

Operators approximating first derivative of an image function are sometimes Introduction and called compass operators because of the ability to determine gradient directions.

Faculty of Software Digital Image Processing Prewitt Mask

FuJian Normal University

Prewitt Mask

Faculty of Software Digital Image Processing Prewitt Operator

6