In the last lecture, we saw that the box averaging filter induces artifacts in the filtered output whereas the Gaussian filter does not. Frequency domain analysis has an answer for this. Frequency domain analysis will help us understand how the filters will affect the low, mid, and high frequencies in the image. Now, you might be wondering images and frequencies, how are they related, Right? Well, frequency domain analysis, which you will witness for yourself in a bit is a powerful tool for doing image analysis. To introduce frequency domain of images, let us look at this picture. If we plot the intensity values of the middle row as a signal with x-axis as the column, and y-axis as the intensity value, you would see a digital signal plot that would look like this. Now, for an image with more texture and variations like this one, you would see a plot like this. You could observe that the more details in terms of edges and texture produce an image that has more complex intensity plot like this one. This can be viewed as a signal comprising of multiple frequencies. To analyze these frequencies, we will use a powerful technique from signal processing called Fourier analysis. According to Fourier, any continuous signal can be approximated as a summation of a bunch of sinusoids with variations and amplitudes, frequencies, and phases. In the context of digital image processing, we shall study the representation of a 2D image in the Fourier domain. We will see later on that there are many domains in which you can analyze the frequencies of an image like wavelengths and discrete cosine transform domain. But for now, let us limit our discussion to Fourier domain. When you convert the 2D image into Fourier domain using the transform equation displayed, you would see an image like this. Let us vary the content in the image and check how it affects the Fourier image. You can observe that most of the information in the image is centered around the origin of the Fourier plot. It represents the low frequencies of the image. All the high frequencies which are the resultant of edges, and texture in the image show up farther from the origin. Let us compare this to the Fourier image with only vertical edges. Now, let us look at the Fourier image with only horizontal edges. Do you see a pattern emerging? How would it look when we rotate the image by 45 degrees? Now, coming back to the question of why a box averaging filter induces artifacts and why Gaussian does not, let us look at these filters in frequency domain. Do you notice that the box filter has high-frequency components and Gaussian does not? Hopefully, that answers your question about why we have artifacts when we use a box filter. In Fourier domain, convolution operation becomes multiplication. Hence, if we multiply Fourier transform of a generic image with the Fourier transform of the filter, we get an output image which would be the same as the output image that you get when you use a filter and the image in spatial domain. The presence of high-frequency values in the Fourier transform of a box filter will allow those specific frequencies to pass through. That is the reason you witness the extra edge artifacts in the smoothened image that used the box averaging filter. We hope this lecture has convinced you how important frequency domain analysis is in the field of image processing. Next, we will learn the concepts of multi-resolution image processing, which borrows concepts from both the spatial and frequency domain.