Last active
January 9, 2016 16:07
-
-
Save atarabi/e9594d94059cf2b68390 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cv2 | |
def ParamsSetup(): | |
params = ( | |
('FFT Division', 'float', {'value': 12.0, 'minvalue': 1.0, 'maxvalue': 1000.0}), | |
) | |
return {'params': params, 'mode': 'RGB'} | |
def SmartRender(in_data, params, input_): | |
gray = cv2.cvtColor(input_, cv2.COLOR_RGB2GRAY) | |
fft = np.fft.fft2(gray) | |
fft = np.log(np.fft.fftshift(np.abs(fft)) + 1.0) | |
fft_division = max(1.0, params['FFT Division']) | |
fft /= fft_division | |
return fft |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment