mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-06 13:30:21 +08:00
Convert to ubyte dtype explicitly for python 3
This commit is contained in:
@@ -10,10 +10,11 @@ import matplotlib.pyplot as plt
|
||||
from skimage import data
|
||||
from skimage.filter.rank import entropy
|
||||
from skimage.morphology import disk
|
||||
from skimage.util import img_as_ubyte
|
||||
|
||||
|
||||
# defining a 8- and a 16-bit test images
|
||||
a8 = data.camera()
|
||||
a8 = img_as_ubyte(data.camera())
|
||||
a16 = a8.astype(np.uint16) * 4
|
||||
|
||||
ent8 = entropy(a8, disk(5)) # pixel value contain 10x the local entropy
|
||||
|
||||
Reference in New Issue
Block a user