I have applied a laplace filter mask to an image and now I want to find the amplitude and freqency response of a laplacian filter: [[1,1,1], [1,-8,1], [1,1,1] ]. I know I need to first find the transfer function, however, I am unable to do this as well programatically in python.
Here is the code I have currently:
from matplotlib.pyplot import imread
import matplotlib.pyplot as plt
from scipy.ndimage.filters import convolve
import numpy as np
import cv2 as cv
laplaceMask = np.array([ [1,1,1], [1,-8,1], [1,1,1] ])
img = imread("download.jpg")
channels = []
for channel in range(3):
result = convolve(img[:,:,channel], laplaceMask)
channels.append(result)
img = np.dstack((channels[0], channels[1], channels[2]))
plt.imshow(img)
plt.show()