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
#!/bin/bash | |
apt update; | |
apt-install -y wget zip; | |
mkdir -p results; | |
cd results; | |
rm links.txt | |
touch links.txt |
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
def wiener_deconv_filter(img, kernel, K = 10): | |
h, w = img.shape | |
kh, kw = kernel.shape | |
temp = np.copy(img) | |
kernel = np.pad(kernel, [(0, h - kh), (0, w - kw)], 'constant') | |
temp = fft2(temp) | |
kernel = fft2(kernel) | |
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 | |
from numpy.fft import fft2, ifft2 | |
def wiener_denoising_filter(img, sigma, K = 10): | |
h, w = img.shape | |
temp = fft2(img) | |
kernel = (np.abs(temp) ** 2) / (h * w) | |
kernel = kernel / (kernel + sigma * sigma) |
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
F_mag = np.fft.fft2(im_magnutide[:,:,0]) | |
F_ph = np.fft.fft2(im_phase) | |
mag = np.absolute(F_mag) | |
phase = np.arctan2(F_ph.imag, F_ph.real) | |
re = np.multiply(mag, np.cos(phase)) | |
im = np.multiply(mag, np.sin(phase)) | |
res = re + 1j * im |
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
(-a_7^2+2*a_6*a_7+2*a_4*a_7-a_10^2-a_11^2+2*a_5*a_8-2*a_6*a_8+2*a_3*a_9-2*a_5*a_9+2*a_2*a_10-2*a_3*a_10+2*a_1*a_11-2*a_2*a_11-2*a_9*a_11+4*a_10*a_11+2*a_0*l-2*a_1*l-2*a_8*l+4*a_9*l-2*a_10*l-2*a_8*a_4)*x^11*+(a_6^2-2*a_8*a_6+2*a_4*a_6-a_7^2+a_10^2-a_11^2+a_4^2+2*a_5*a_7+2*a_3*a_8+2*a_2*a_9-2*a_5*a_9+2*a_1*a_10-2*a_3*a_10-2*a_9*a_10+2*a_0*a_11-2*a_2*a_11-2*a_8*a_11+2*a_9*a_11+2*a_10*a_11-2*a_1*l-2*a_7*l+2*a_8*l+2*a_9*l-2*a_10*l-2*a_8*a_4)*x^10+(-a_7^2+2*a_3*a_7-2*a_11*a_7+2*l*a_7-a_9^2-a_11^2+l^2+2*a_5*a_6+2*a_2*a_8-2*a_6*a_8+2*a_1*a_9-2*a_5*a_9+2*a_0*a_10-2*a_3*a_10-2*a_8*a_10+2*a_9*a_10-2*a_2*a_11+2*a_8*a_11+2*a_10*a_11-2*a_1*l-2*a_6*l+2*a_9*l-2*a_10*l+2*a_5*a_4-2*a_8*a_4-2*l*a_4)*x^9+(a_5^2-2*a_9*a_5-2*l*a_5-a_7^2+a_9^2-a_11^2+l^2+2*a_3*a_6+2*a_2*a_7+2*a_1*a_8-2*a_6*a_8+2*a_0*a_9-2*a_8*a_9-2*a_3*a_10-2*a_7*a_10+2*a_8*a_10-2*a_2*a_11-2*a_6*a_11+2*a_7*a_11+2*a_10*a_11-2*a_1*l+2*a_6*l+2*a_9*l-2*a_10*l+2*a_11*l+2*a_3*a_4-2*a_8*a_4-2*a_11*a_4+2*l*a_4)*x^8+(-a_7^2+2*a_1*a_7-2*a_9*a_7+2*a_10*a_7-a_8^2-2*l^2+2*a_3*a |
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
#include <iostream> | |
#include <cstdlib> | |
#include <xmmintrin.h> | |
#include <ctime> | |
float *construct(size_t W, size_t H) { | |
float *arr = new float[W * H]; | |
for (size_t i = 0; i < H; ++i) { | |
for (size_t j = 0; j < W; ++j) { | |
arr[i * W + j] = static_cast<float>(std::rand()); |
NewerOlder