You are on page 1of 5

Research on convolution

Convolution: is a mathematical operation on two functions, producing a third function that is typically viewed as a
modified version of one of the original functions. The convolution can be defined for functions on groups other than Euclidean space. In particular, the circular convolution can be defined for periodic functions (that is, functions on the circle), and the discrete convolution can be defined for functions on the set of integers. These generalizations of the convolution have applications in the field of numerical analysis and numerical linear algebra, and in the design and implementation of finite impulse response filters in signal processing. Convolution is a widely used technique in image and signal processing applications. In image processing the convolution operator is used as a filter to change the characteristics of the image; sharpen the edges, blur the image or remove the high or low frequency noise. In seismic processing a convolution can be used to extrapolate the propagating wave field forward or backward. In signal processing it can be used to suppress unwanted portions of the signal or separate the signal in different parts.

2D Convolution: 2D convolution is just extension of 1D convolution by convolving both horizontal and vertical
directions in 2 dimensional spatial domains. Convolution is frequently used for image processing, such as smoothing, sharpening, and edge detection of images. Two dimensional (2D) convolutions are sometimes the most time consuming parts of an application. It is therefore useful to consider different implementations of a 2D convolution and compare the performance.

Examples: Convolution:
1. 2. 3. 4. Express each function in terms of a dummy variable . Reflect one of the functions: h( ) h( ). Add a time-offset, t, which allows h(t ) to slide along the -axis. Start t at - and slide it all the way to + . Wherever the two functions intersect, find the integral of their product. In other words, compute a sliding, weighted-average of function f( ), where the weighting function is h( ). f( )

h( )

Figure 1: Two basic signals that we will convolve together.

(a) Reflected square pulse.

(b) Reflected and shifted square pulse.

Figure 2: h( ) and h(t )

(a) No overlap.

(b) h(t ) on its way "into" t( )

(c) h(t ) on its way "out of" t( )

(d) No overlap.

2D convolution:

Examine an example to clarify how to convolve in 2D space. Let's say that the size of impulse response (kernel) is 3x3, and it's values are( a, b, c, d,...) Notice the origin (0,0) is located in the center of kernel. Let's pick a simplest sample and compute convolution, for instance, the output at (1, 1) will be;

It results in sum of 9 elements of scaled and shifted impulse responses. The following image shows the graphical representation of 2D convolution.

2D Convolution

Notice that the kernel matrix is flipped both horizontal and vertical direction before multiplying the overlapped input data, because x[0,0] is multiplied by the last sample of impulse response, h[1,1]. And x[2,2] is multiplied by the first sample, h[-1,-1].

2D convolution for image processing


Filtering an Image: Image filtering is useful for many applications, including smoothing, sharpening, removing noise, and edge detection. A filter is defined by a kernel, which is a small array applied to each pixel and its neighbors within an image. In most applications, the center of the kernel is aligned with the current pixel, and is a square with an odd number (3, 5, 7, etc.) of elements in each dimension. The process used to apply filters to an image is known as convolution, and may be applied in either the spatial or frequency domain Within the spatial domain, the first part of the convolution process multiplies the elements of the kernel by the matching pixel values when the kernel is centered over a pixel. The elements of the resulting array (which is the same size as the kernel) are averaged, and the original pixel value is replaced with this result. The CONVOL function performs this convolution process for an entire image. Within the frequency domain, convolution can be performed by multiplying the FFT (Fast Fourier Transform) of the image by the FFT of the kernel, and then transforming back into the spatial domain. The kernel is padded with zero values to enlarge it to the same size as the image before the forward FFT is applied. These types of filters are usually specified within the frequency domain and do not need to be transformed. IDL's DIST and HANNING functions are examples of filters already transformed into the frequency domain. The following examples in this section will focus on some of the basic filters applied within the spatial domain using the CONVOL function:
y Low pass filtering. y High pass filtering.

Low Pass Filtering: A low pass filter is the basis for most smoothing methods. An image is smoothed by
decreasing the disparity between pixel values by averaging nearby pixels Using a low pass filter tends to retain the low frequency information within an image while reducing the high frequency information. An example is an array of ones divided by the number of elements within the kernel, such as the following 3 by 3 kernel:

High Pass Filtering: A high pass filter is the basis for most sharpening methods. An image is sharpened when
contrast is enhanced between adjoining areas with little variation in brightness or A high pass filter tends to retain the high frequency information within an image while reducing the low frequency information. The kernel of the high pass filter is designed to increase the brightness of the center pixel relative to neighboring pixels. The kernel array usually contains a single positive value at its center, which is completely surrounded by negative values. The following array is an example of a 3 by 3 kernel for a high pass filter:

You might also like