mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-01 10:19:06 +08:00
rename some test to demo
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
from skimage import data
|
||||
from skimage.rank import crank8_percentiles
|
||||
from skimage.rank import crank16_bilateral
|
||||
|
||||
if __name__ == '__main__':
|
||||
a8 = (data.coins()).astype('uint8')
|
||||
|
||||
a16 = (data.coins()).astype('uint16')*16
|
||||
selem = np.ones((20,20),dtype='uint8')
|
||||
f1 = crank8_percentiles.mean(a8,selem = selem,p0=.1,p1=.9)
|
||||
f2 = crank16_bilateral.mean(a16,selem = selem,bitdepth=12,s0=500,s1=500)
|
||||
|
||||
plt.figure()
|
||||
plt.imshow(np.hstack((a8,f1)))
|
||||
plt.colorbar()
|
||||
|
||||
plt.figure()
|
||||
plt.imshow(np.hstack((a16,f2)))
|
||||
plt.colorbar()
|
||||
|
||||
plt.show()
|
||||
Reference in New Issue
Block a user