👨💻 Problem Statement/ Requirements:
- Write a method for such a filter that creates a hybrid image.
- This filter used for creating the hybrid image should combine the high-pass filtered version of one image and low-pass filtered version of another image.
- Gaussian filter is used for constructing the hybrid images with different cut-off frequencies. Description of the methods to be coded in Python are as mentioned below:
💻 Algorithms: 🛠️ Method 1: my_imfilter (image, filter) method is implemented which returns a filtered image.
- In this method we create copy of the image to store the value of the filtered image.
- Image is padded according to the filter size.
- Filter is applied using Convolution. (Convolution is the process of changing the image by applying the kernel to each pixel and to the local neighbours of these pixels in the image).
- Filtered image is returned as the return value of this method.
🛠️ Method 2: create_hybrid_image (image1, image2, cutoff_frequency) method is used to generate low frequency, high frequency and filtered image.
- Gaussian kernel is generated.
- Low frequency image is generated using the gaussian kernel.
- High frequency image is generated.
- Hybrid image is generated by combining or summing up the low and high frequency images.