S
S
Sergey Sokolov2015-11-19 23:32:53
Image processing
Sergey Sokolov, 2015-11-19 23:32:53

How to invert the frequency spectrum of an image?

What happens if you flip the frequency spectrum of a signal - high frequencies become low, and low frequencies become high?
I don't know much about the mathematics of signal processing. In general terms, I present what the Fourier transform is, and what the frequency decomposition of the image is.
For an audio signal , as they say , this is done by trivially multiplying by -1 samples through one.
Question: how to do this for a two-dimensional image?
I wonder what the picture will look like in which the frequency spectrum is turned upside down? And how to implement it - is it much more difficult than the inversion of readings through one?
The general idea, by analogy with the frequency decomposition of an image for professional retouching:

картинка -> FFT -> (реверс спектра) -> IFFT -> редактирование 
    -> FFT -> (реверс спектра) -> IFFT -> Profit!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AelDeyr, 2015-11-20
@sergiks

Take a picture, the easiest way is some uncompressed format, like BMP.
Expand the image into a one-dimensional array of pixels. For BMP it will be Array of Point(R,G,B,A). You work with this array according to the scheme you described.
If the topic is interesting, google it: "lossy compression algorithms" "using wavelets to compress images" "parsing the Jpeg encoding algorithm"
If you have a ready-made algorithm, here's an article (not mine) on Habré once on Haar wavelets: habrahabr.ru /post/168517 (this is a theory, at the end of this article there is a link to practice with ready-made sources) It
will not be difficult to replace the Haar-to-Fourier transformation kernel in the sources.
ps Pictures are very interesting. At one time, when I wrote such a program for myself, then I played with the image database for four hours. It is especially interesting to watch in real time how the high frequencies gradually add volume and color to the base image. Or how different kernels decompose the source file in different ways.
pps Very visual visualization. Such observations will then help you quickly figure out what your neural network has learned (what individual weights are responsible for, etc.)
ppps If you are completely lazy, you can take Wolfram Mathematica, they have all these algorithms implemented.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question