In: Computer Science
Can we use the convolution (or cross-correlation) operation to implement:
(a) the mean filter, (b) the median filter, (c) the Sobel operator and (d) the Laplacian operator?
a) We can use convolution operation to implement mean filter. Mean filtering is a very simple, intuitive and easy to implement method of smoothing images, i.e. reducing the amount of intensity variation between one pixel and the next pixel. It is mostly used to reduce noise in images. In mean filtering we replace each pixel value in an image with the mean or average value of its neighbors, including itself. This has the effect of eliminating pixel values which are unrepresentative of their surroundings. Mean filtering is usually thought of as a convolution filter. Like other convolutions it is based around a kernel, which represents the shape and size of the neighborhood to be sampled when calculating the mean. Correlation and Convolution are basic operations that we will perform to extract information from images. The convolution filters use local neighbors to compute the weighted average, and each pixel is used multiple times by its neighbors.
b) The Median Filter is a non-linear digital filtering technique, which is used to remove noise from an image or signal. Such noise reduction is a typical pre-processing step to improve the results of later processing. Median filtering is very widely used in digital image processing because, under certain conditions, it preserves edges while removing noise. Median Filters are useful in reducing random noise, especially when the noise amplitude probability density has large tails, and periodic patterns. The median filtering process is accomplished by sliding a window over the image. The filtered image is obtained by placing the median of the values in the input window, at the location of the center of that window, at the output image. Convolution filters are also known as Linear filters as they can be represented using a matrix multiplication. Median filter is a non linear filter. So, convolution operation can not be used to implement Median filter.
c) The Sobel operator or sobel filter is used in image processing and computer vision, particularly within edge detection algorithms where it creates an image emphasising edges. Technically, it is a discrete differentiation operator, computing an approximation of the gradient of the image intensity function. At each point in the image, the result of the sobel operator is either the corresponding gradient vector or the norm of this vector. It is based on convolving the image with a small, separable, and integer-valued filter in the horizontal and vertical directions and is therefore relatively inexpensive in terms of computations. Sobel Operator tries to find out the amount of the difference by placing the gradient matrix over each pixel. Working on Sobel operator is based on Kernel Convolution. If all the pixels of images were of the same value, then the convolution would result in a resultant sum of zero. So the gradient matrix will provide a big response when one side is brighter. The Sobel Operator is very quick to execute as well. Since it produces the same output every time you execute it over an image, makes Sobel Operator a stable edge detection technique for image segmentation. So, we can use convolution operation to implement Sobel Operator.
d) The Laplacian is a 2-D isotropic measure of the 2nd spatial derivative of an image. Laplacian Operator is also a derivative operator which is used to find edges in an image. Laplacian is a second order derivative mask. The Laplacian of an image highlights regions of rapid intensity change and is therefore often used for edge detection. The Laplacian is often applied to an image that has first been smoothed with something approximating a Gaussian smoothing filter in order to reduce its sensitivity to noise. The Laplacian operator of an image can be calculated using a convolution filter. Since the input image is represented as a set of discrete pixels, we have to find a discrete convolution kernel that can approximate the second derivatives in the definition of the Laplacian. Laplacian can be calculated using standard convolution methods. So, convolution operation can be used to implement Laplacian operator.