Professional Documents
Culture Documents
Summary
Fun With Gaussian Smoothing
Gaussian glow
f g h = α f + (1 − α)g
Fun With Gaussian Smoothing
Gaussian glow
I python code
import scipy.misc as msc
import scipy.ndimage as img
f = 1. * msc.imread(’input.png’)
g = img.filters.gaussian_filter(f, sigma=s)
h = a * f + (1.-a) * g
f g h = α f + (1 − α)g
Fun With Gaussian Smoothing
f g h = f + α g, α = 6
Fun With Gaussian Smoothing
f = 1. * msc.imread(’input.png’)
g = img.filters.gaussian_gradient_magnitude(f, sigma=s)
h = f + a * g
f = 1. * msc.imread(’input.png’)
g = img.filters.gaussian_gradient_magnitude(f, sigma=s)
R = f
G = f + a * g
B = f
h = np.array([R, G, B])
image aging
image aging
I python code
import numpy as np
import scipy.ndimage as img
y,x = f.shape
# sepia toning
m = h.mean() # average intensity in image h
R = (162-m) + h # set average red to 162
G = (138-m) + h # set average green to 138
B = (101-m) + h # set average blue to 101
Fun With Gaussian Smoothing
f (x, y) g(x, y)
Fun With Gaussian Smoothing
f (x, y) g(x, y)
Fun With Gaussian Smoothing
greyscale image
Fun With Gaussian Smoothing
non-maximum suppression
Fun With Gaussian Smoothing
# apply morphology
l = img.morphology.binary_dilation(k)
m = img.morphology.binary_fill_holes(l)
Fun With Gaussian Smoothing
# final result
g = np.array([R, G, B])
Fun With Gaussian Smoothing