Heal the mushrooms!

This is a high resolution scan of a mushroom identity postcard. How well can you descreen the image?

More interestingly, let’s look at the Fourier transform:
f
While I worked with Fourier series in electronics, I’m a bit baffled by this image. The data seems to be mirrored - the left half is identical to the right half, flipped vertically and horizontally. Why? The top-left quarter is only similar to the bottom, but not identical. How do I read the bright spots? How do I fix the screen pattern by manipulating the spots - should I clone them out, heal them (Poisson editing), or just paint over them? And if just paint over them, should I use black, white or medium-gray? I tried all of these variations, but it’s still a mystery what will result until I hit the button to redo the transform.

That is phase space: both A (amplitude) and θ (phase angle) can be negative. In a Fourier transform you have negative frequency as well.

This thread has the most info: [Feature Request] FFT denoise. In post #13, I used the clone tool.

Fascinating! Especially the inner circle with 12 peaks.

Interpreting 2-D FTs is not straightforward – and I work mainly with 1-D signals, so I can’t help much. However, I can say that playing with the peaks in the frequency domain and then going back is not a good idea. First, doing so is basically the equivalent of a low-pass filter. Second, if you don’t do it carefully, you’ll get artifacts (ringing) in the spatial domain; see for instance matlab - Why is it a bad idea to filter by zeroing out FFT bins? - Signal Processing Stack Exchange.

As an aside, there are a few algorithms designed to solve this problem, e.g. Google Scholar. But I don’t have experience with any of them.

I was testing Fourier Transform via g’mic, doesn’t seem to work as expected in Krita. There’s cloning or painting black over.

Also, I think you may want to try out Smooth[Median]. It gives me ok result. Numbers are a problem though.

Here is my result. I used Iain Remove Pattern from my testing folder and the Smooth [Anisotrpic].
Some of the text is degraded, but that could be fixed with some masking with the original image.

With regards to interpreting a 2D FFT, the distance from the centre indicates the size of the feature. The bright spot in the middle represents the whole image and the edges of the plot are pixel-sized. The angle relative to the centre indicates the orientation of the feature. a horizontal line will appear as bright spots on the verticle axis of the FFT.

6 Likes

In the sample Fourier transform above, the right half is an identical flipped copy of the left half. Is that always the case? If so, why does G’MIC do that - why not just output the unique section, and save the user half the work and half the needed RAM?

Maybe I could add this as an option indeed.
G’MIC is actually able to compute the FFT of complex-valued signals and images, but this is not a feature used by the FFT filter in the plug-in.

1 Like

Repeat builtin guided filter and hot pixel removal. Kept a little pattern to maintain detail.

Bonus A more interesting magnitude (excuse the low quality resizing).

My DSP skills are extremely rusty and it’s 11 PM, but I’m fairly certain this mirroring around DC is to be expected if you only consider real and not complex values.