4 ms·
Do you have any examples of this? Sounds cool
by seanlinehan 9y ago
Do 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))