In [1]:
# log 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]:
# 46 * ln(256) ~ 255
log_img = (46*np.log(img+1)).astype(np.uint8)
plt.figure(figsize=(12,12))
plt.imshow(log_img, cmap='gray')
Out[2]:
In [3]:
histogram = np.histogram(img.flatten(), bins=range(256))
plt.xlim((0,255))
plt.plot(histogram[0])
Out[3]:
This seems quite odd.
In [4]:
histogram = np.histogram(log_img.flatten(), bins=range(256))
plt.xlim((0,255))
plt.plot(histogram[0])
Out[4]:
In [5]:
# histogram of other pictures taken with SP8
img2 = image.imread('MP1.tif')
img3 = image.imread('MP2.tif')
hist2 = np.histogram(img2, bins=range(256))
hist3 = np.histogram(img3, bins=range(256))
plt.xlim((0,255))
plt.plot(hist2[0])
plt.figure()
plt.xlim((0,255))
plt.plot(hist3[0])
Out[5]:
Why does some few intensities get such a high count?