45
Basics of Edge Detection PRESENTED BY : SIMRANJIT SINGH

Basics of edge detection and forier transform

Embed Size (px)

DESCRIPTION

These slides presents simple basics of edge detection and fourier transform in context of image processing

Citation preview

Page 1: Basics of edge detection and forier transform

Basics of Edge Detection

PRESENTED BY :

SIMRANJIT SINGH

Page 2: Basics of edge detection and forier transform

OVERVIEW

Introduction to digital image processing

Applications

Edge Detection techniques

Discrete Fourier Transform

Discrete Sine Transform

Discrete Cosine Transform

Discrete wavelet Transform

Page 3: Basics of edge detection and forier transform

What is Digital image Processing?

IT IS A FIELD OF COMPUTER SCIENCE WHICH DEALS WITH THE PROCESSING OF DIGITAL IMAGE BY A MEANS OF DIGITAL COMPUTER.

Page 4: Basics of edge detection and forier transform

What is a Digital Image?

An image may be defined as 2-d function f(x,y) where x and y are spatial co-ordinates and the amplitude of f at any pair of co-ordinates(x,y) and the intensity values of image at that point.

When x,y and the intensity values of f are all finite, discrete quantities, we call the image a Digital Image

Page 5: Basics of edge detection and forier transform

Definition of Edges

Edges are significant local changes of intensity in an image.

Page 6: Basics of edge detection and forier transform

Goal of Edge Detection

Produce a line “drawing” of a scene from an image of that scene.

Page 7: Basics of edge detection and forier transform

Why is Edge detection Useful?

Important features can be extracted from the edges of an image (e.g., corners, lines, curves).

These features are used by higher-level computer vision algorithms (e.g., recognition).

Page 8: Basics of edge detection and forier transform

Effect of Illumination

Page 9: Basics of edge detection and forier transform

Modeling Intensity Changes

Step edge: the image intensity abruptly changes from one value on one side of the discontinuity to a different value on the opposite side.

Page 10: Basics of edge detection and forier transform

Ramp edge: a step edge where the intensity change is not instantaneous but occur over a finite distance.

Page 11: Basics of edge detection and forier transform

Ridge edge: the image intensity abruptly changes value but then returns to the starting value within some short distance (i.e., usually generated by lines).

Page 12: Basics of edge detection and forier transform

Roof edge: a roof edge where the intensity change is not instantaneous but occur over a finite distance (i.e., usually generated by the intersection of two surfaces).

Page 13: Basics of edge detection and forier transform

Main steps in Edge Detection.(1) Smoothing: suppress as much noise as possible,

without destroying true edges.

(2) Enhancement: apply differentiation to enhance the quality of edges (i.e., sharpening).

(3) Thresholding: determine which edge pixels should be discarded as noise and which should be retained (i.e., threshold edge magnitude).

(4) Localization: determine the exact edge location.

Page 14: Basics of edge detection and forier transform

Edge Detection Using Derivatives

Often, points that lie on an edge

are detected by:

(1) Detecting the local maxima

or minima of the first derivative.

(2) Detecting the zero-crossings

of the second derivative.2nd derivative

1st derivative

Page 15: Basics of edge detection and forier transform

Edge Detection Using First Derivative (Gradient)

The first derivate of an image can be computed using the gradient:

Page 16: Basics of edge detection and forier transform

Gradient Representation

The gradient is a vector which has magnitude and direction:

Magnitude: indicates edge strength.

Direction: indicates edge direction.

i.e., perpendicular to edge direction

Page 17: Basics of edge detection and forier transform

Approximate Gradient

Approximate gradient using finite differences:

Page 18: Basics of edge detection and forier transform

We can implement and using the following masks:

(x+1/2,y)

(x,y+1/2)*

*

good approximationat (x+1/2,y)

good approximationat (x,y+1/2)

Page 19: Basics of edge detection and forier transform

and can be implemented using the following masks:

Page 20: Basics of edge detection and forier transform

Perwitt Operator

Setting c = 1, we get the Prewitt operator

Page 21: Basics of edge detection and forier transform

Sobel Operator

Setting c = 2, we get the Sobel operator

Page 22: Basics of edge detection and forier transform

Prewitt Edge Detector

Page 23: Basics of edge detection and forier transform

Sobel Edge Detector

Page 24: Basics of edge detection and forier transform

Canny Edge Detector

Page 25: Basics of edge detection and forier transform

Fourier Transform

Page 26: Basics of edge detection and forier transform

Fourier Series and Fourier TransformA Brief History

Jean Baptiste Joseph Fourier was born in 1768 in Auxxerra.

The contribution for which he is most remembered was outlined in a memoir in 1807 and published in 1822 in his books.

His book La Theorie de la Chaleur(The Analytic Theory of Heat) was translated into 55years later by freeman.

Page 27: Basics of edge detection and forier transform

His contribution in this field states that any periodic functions can be expressed as the sum of sines and /or cosines of different frequencies, each multiplied by a different coefficients.

It does not matter how complicated the function is if it satisfies some mild mathematical conditions it can be represented by such a sum.

However this idea was met with skepticism.

Page 28: Basics of edge detection and forier transform

The function that are not periodic can also be expressed as a integral of sines or cosines multiplied by a weighing function. This formulation is called FOURIER TRANSFORM.

Its utility is even greater than the Fourier series in many theoretical and applied discipline.

Both have the characteristic of reconstruction means the original function can be obtained again by applying the inverse process.

Page 29: Basics of edge detection and forier transform

The initial applications of Fourier's ideas was in the field of heat diffusion

During the past century and especially in the past 50 years entire industries and academic disciplines have flourished as a result of Fourier’s ideas.

In 1960 the Fast Fourier Transform(FFT) discovery revolutionized the field of signal processing

Page 30: Basics of edge detection and forier transform

Discrete Fourier Transform

In mathematics, the discrete Fourier transform (DFT) converts a finite list of equally spaced samples of a function into the list of coefficients of a finite combination of complex sinusoids, ordered by their  frequencies, that has those same sample values. It can be said to convert the sampled function from its original domain (often time or position along a line) to the frequency domain.

The input samples are complex numbers (in practice, usually real numbers), and the output coefficients are complex as well.

Page 31: Basics of edge detection and forier transform

The DFT is the most important discrete transform, used to perform Fourier analysis in many practical applications. In digital signal processing, the function is any quantity or signal that varies over time, such as the pressure of a sound wave, a radio signal, or daily temperature readings, sampled over a finite time interval (often defined by a window function).

In image processing, the samples can be the values of pixels along a row or column of a raster image

Page 32: Basics of edge detection and forier transform

The DFT of a vector x of length n is another vector y of length n:

where ω is a complex nth root of unity:

This notation uses i for the imaginary unit, and p and j for indices that run from 0 to n–1. The indices p+1 and j+1 run from 1 to n, corresponding to ranges associated with MATLAB vectors.

Page 33: Basics of edge detection and forier transform

DISCRETE SINE TRANSFORM

In mathematics, the discrete sine transform (DST) is a Fourier-related transform similar to the discrete Fourier transform (DFT), but using a purely real matrix.

 It is equivalent to the imaginary parts of a DFT of roughly twice the length, operating on real data with odd symmetry (since the Fourier transform of a real and odd function is imaginary and odd).

where in some variants the input and/or output data are shifted by half a sample.

Page 34: Basics of edge detection and forier transform

Syntax

y=dst(x)

y=dst(x,n)

Description:

The dst function implements the following equation:

Page 35: Basics of edge detection and forier transform

y=dst(x) computes the discrete sine transform of the columns of x. For best performance speed, the number of rows in x should be 2m - 1, for some integer m.

y=dst(x,n) pads or truncates the vector x to length n before transforming.

If x is a matrix, the dst operation is applied to each column.

The idst function implements the following equation

Page 36: Basics of edge detection and forier transform

x=idst(y) calculates the inverse discrete sine transform of the columns of y. For best performance speed, the number of rows in y should be 2m - 1, for some integer m.

x=idst(y,n) pads or truncates the vector y to length n before transforming.

If y is a matrix, the idst operation is applied to each column.

Page 37: Basics of edge detection and forier transform

DISCRETE COSINE TRANSFORM

A discrete cosine transform (DCT) expresses a finite sequence of data points in terms of a sum of cosine functions oscillating at different frequencies.

DCTS are important to numerous applications in science and engineering, from lossy compression of audio 

(e.g. MP3) and images (e.g. JPEG) (where small high-frequency components can be discarded), to spectral methods for the numerical solution of partial differential equations.

Page 38: Basics of edge detection and forier transform

Syntax

y=dct(x)

y=dct(x,n)

Description:

y= dct(x) returns the unitary discrete cosine transform of x.

Page 39: Basics of edge detection and forier transform

Where

N is the length of x, and x and y are the same size. If x is a matrix, dct transforms its columns. The series is indexed from n = 1 and k = 1 instead of the usual n = 0 and k = 0 because MATLAB vectors run from 1 to N instead of from 0 to N- 1.

y = dct(x,n) pads or truncates x to length n before transforming.

The DCT is closely related to the discrete Fourier transform. You can often reconstruct a sequence very accurately from only a few DCT coefficients, a useful property for applications requiring data reduction.

Page 40: Basics of edge detection and forier transform

Implementation

Page 41: Basics of edge detection and forier transform
Page 42: Basics of edge detection and forier transform

Discrete Wavelet Transform(DWT)

In numerical analysis and functional analysis, a discrete wavelet transform (DWT) is any wavelet transform for which the wavelets are discretely sampled. As with other wavelet transforms, a key advantage it has over Fourier transforms is temporal resolution: it captures both frequency and location information (location in time).

The Wavelet Transform provides a time-frequency representation of the signal.

Page 43: Basics of edge detection and forier transform

Wavelet transform decomposes a signal into a set of basis functions.

These basis functions are called wavelets

Wavelets are obtained from a single prototype wavelet y(t) called mother wavelet by dilations and shifting:

where a is the scaling parameter and b is the shifting parameter

Page 44: Basics of edge detection and forier transform

Syntax

[cA,cD] = dwt(X,'wname')

[cA,cD] = dwt(X,'wname','mode',MODE)

Description

The dwt command performs a single-level one-dimensional wavelet decomposition with respect to either a particular wavelet or particular wavelet decomposition filters (Lo_D and Hi_D) that you specify

Page 45: Basics of edge detection and forier transform

[cA,cD] = dwt(X,'wname') computes the approximation coefficients vector cA and detail coefficients vector cD, obtained by a wavelet decomposition of the vector X. The string 'wname' contains the wavelet name.

[cA,cD] = dwt(X,Lo_D,Hi_D) computes the wavelet decomposition as above, given these filters as input:

Lo_D is the decomposition low-pass filter.

Hi_D is the decomposition high-pass filter.