I have this image:
I am trying to put the background into focus in order to perform edge-detection on the image. What would be the methods available to me (either on
space/frequency filed)?
What I tried is the following:
kernel = np.array([[-1,-1,-1], [-1,9,-1], [-1,-1,-1]])
im = cv2.filter2D(equ, -1, kernel)
This outputs this image:
I also played around with the centre value but with no positive result.
I also tried this:
psf = np.ones((5, 5)) / 25
equ = convolve2d(equ, psf, 'same')
deconvolved = restoration.wiener(equ, psf, 1, clip=False)
plt.imshow(deconvolved, cmap='gray')
With no appreciable changes to the image.
Any help on the matter is greatly appreciated!
EDIT:
Here is the code that I took from here:
psf = np.ones((5, 5)) / 25
equ = convolve2d(equ, psf, 'same')
deconvolved, _ = restoration.unsupervised_wiener(equ, psf)
plt.imshow(deconvolved, cmap='gray')
and here is the output:
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…