4 ms·
Well, there's another neat thing that you can do if you want to generate an interesting 2D -> 2D representation: * Take fourier transform of the image for each
by crispyambulance 9y ago
Well, there's another neat thing that you can do if you want to generate an interesting 2D -> 2D representation:
* Take fourier transform of the image for each color R, G, B
* Randomly scramble the phase of the transformed image.
* Perform the fourier inverse of that scrambled phase image.
The result is another 2D image with the same colors AND spatial frequencies as the original image. It looks like you took the original photo and vaporized it into gas. Interesting.
- seanlinehan 9y agoDo you have any examples of this? Sounds cool
- yorwba 9y agoI did a Jupyter notebook http://nbviewer.jupyter.org/github/Yorwba/image_frequency_scrambling/blob/master/Image%20Frequency%20Scrambling.ipynb http://nbviewer.jupyter.org/github/Yorwba/image_frequency_sc... I should have probably written more comments, but I really need to go sleep now.
- crispyambulance 9y agoYep, that's it! Here's the same thing in R... library(imager) download.file("https://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png",'lena.png', mode = 'wb') lena <- load.image("./lena.png") plot(lena) lena_fft <- FFT(lena) lena_pwr <- sqrt( lena_fft$real^2 + lena_fft$imag^2) lena_ph <- atan2(lena_fft$imag, lena_fft$real) lena_ph[1:512,1:512,1,] <- matrix(runif(512*512,-pi,pi),ncol=512) lena_mess <- FFT(lena_pwr*cos(lena_ph),lena_pwr*sin(lena_ph),inverse = TRUE) plot(sqrt(lena_mess$real^2 + lena_mess$imag^2))
- rijoja 9y agoYes yes fourier transforms is what make mathematicians go mad and or religious.