Skip to content

Instantly share code, notes, and snippets.

View VladimirGl's full-sized avatar

Glazachev Vladimir VladimirGl

  • Saint-Petersburg State University
  • Saint Petersburg
View GitHub Profile
@VladimirGl
VladimirGl / callgraph.png
Last active August 29, 2015 14:27
valgrind
callgraph.png
@VladimirGl
VladimirGl / shit.py
Created February 25, 2017 18:31
phase+mag
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
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)
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)
@VladimirGl
VladimirGl / scrap.sh
Last active April 3, 2020 16:49
parser_history
#!/bin/bash
apt update;
apt-install -y wget zip;
mkdir -p results;
cd results;
rm links.txt
touch links.txt