pythonopencvimage-processingfft

Automatic detection of FFT peaks in image: Python


I have this image, and I want to suppress the peaks in this image, which represnts the scratches in the original image (but that is besides the point). All I want, is to make an algorithm that Automatically Identifies the peaks in the Image and then suppress them (make it 0).

This is the code I wrote through which I have received the given result. You can look at the libraries, and I have code it in Python.

What I want? I want the algorithm to be in Python, which automatically detects the FFT peaks (co-ordinates) and then supress them. If anyone knows, How to achieve this, your help will be highly appreciated. Thanks in advance.


Solution

  • Do not be alarmed by the garbled noisy image in the other answer. That is due to Imagemagick.

    FFT processing really won't help. It may erase some of the directional scratches but what good is that gonna do? Right, not much. And it will introduce other artefacts. My recommendation: forget about FFT.

    Input:

    enter image description here

    Spectrum with blanked-out areas (visualization, not the true data):

    enter image description here

    After correct inverse FFT:

    enter image description here