In [1]:
# power-law spatial filter
from matplotlib import pyplot as plt
from matplotlib import image
import numpy as np
%matplotlib inline
img = image.imread('MP.tif')[...,0]
plt.imshow(img, cmap='gray')
Out[1]:
In [2]:
gamma = 0.5
gamma_img = img**gamma
plt.imshow(gamma_img, cmap='gray')
Out[2]:
In [3]:
gamma = 2
gamma_img = img**gamma
plt.imshow(gamma_img, cmap='gray')
Out[3]: