In this recipe, you will learn how to manipulate images in the frequency domain.
Manipulating image frequencies for image filtration
Getting ready
Install the OpenCV 3.x Python API package and the matplotlib package.
How to do it...
Perform the following steps:
- Import the packages:
import cv2
import numpy as np
import matplotlib.pyplot as plt
- Read the image as grayscale and convert it to the np.float32 datatype:
image = cv2.imread('../data/Lena.png', 0).astype(np.float32) / 255
- Convert the image from the spatial domain to the frequency domain using the discrete...