Professional Documents
Culture Documents
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( )
(a) No overlap.
(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].
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: