Most of my dissertation was devoted to reducing noise in images, and I used a technique that reduced noise in images, while preserving the sharp edges of the information in the image. I quote myself here:
An effective technique for removing noise from the bands is to filter the image using sine-cosine filtering [link] . The low-pass filter is collapsed with two images obtained by obtaining the sine and cosine of the strip pattern image, which are then divided to obtain a tangent, restoring the phase pattern, but with reduced noise. The advantage of this method is that the process can be repeated several times to reduce noise while maintaining the clear details of the phase transitions.
And here is the code I used:
import numpy as np from scipy import ndimage def scfilter(image, iterations, kernel): """ Sineโcosine filter. kernel can be tuple or single value. Returns filtered image. """ for n in range(iterations): image = np.arctan2( ndimage.filters.uniform_filter(np.sin(image), size=kernel), ndimage.filters.uniform_filter(np.cos(image), size=kernel)) return image
There, image was an array representing the image linearly resized to put black at 0 and white at 2 * pi , and kernel is the size in pixels of the image of a uniform filter applied to the data. It doesn't take too many iterations to see a positive result, possibly in the range of 5 to 20.
Hope this helps :)
I_am_Grand
source share