moved example to doc

This commit is contained in:
Olivier Debeir
2012-10-18 09:18:01 +02:00
parent b2da237e14
commit 82d20ca694
3 changed files with 65 additions and 40 deletions
+33
View File
@@ -0,0 +1,33 @@
"""
==============================
Simplified bilateral filtering
==============================
to complete
"""
import numpy as np
import matplotlib.pyplot as plt
from skimage import data
from skimage.morphology import disk
import skimage.rank as rank
a8 = (data.coins()).astype('uint8')
a16 = (data.coins()).astype('uint16')*16
selem = np.ones((20,20),dtype='uint8')
f1 = rank.percentile_mean(a8,selem = selem,p0=.1,p1=.9)
f2 = rank.bilateral_mean(a16,selem = selem,s0=500,s1=500)
selem = disk(50)
f3 = rank.equalize(a16,selem = selem)
# display results
fig, axes = plt.subplots(nrows=3, figsize=(15,5))
ax0, ax1, ax2 = axes
ax0.imshow(np.hstack((a8,f1)))
ax1.imshow(np.hstack((a16,f2)))
ax2.imshow(np.hstack((a16,f3)))
plt.show()