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]:
<matplotlib.image.AxesImage at 0x10850fd68>

In [2]:
gamma = 0.5
gamma_img = img**gamma
plt.imshow(gamma_img, cmap='gray')


Out[2]:
<matplotlib.image.AxesImage at 0x1085f2b00>

In [3]:
gamma = 2
gamma_img = img**gamma
plt.imshow(gamma_img, cmap='gray')


Out[3]:
<matplotlib.image.AxesImage at 0x10874dcf8>