Created
February 12, 2018 18:36
-
-
Save chiffa/58163205d1cede5efd8d74f7754498a3 to your computer and use it in GitHub Desktop.
Otsu threshold debug GIST #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from skimage import io | |
from skimage.filters import rank | |
from skimage.morphology import disk | |
from time import time | |
import numpy as np | |
import pickle | |
# base_image = pickle.load(open('debug_dump.dmp', 'r')) | |
# np.save('debug_image.npy', base_image) | |
base_image = np.load('debug_image.npy') | |
selem2 = disk(50) | |
print 'base image', base_image.shape, base_image.dtype | |
print 'mask', selem2.shape, selem2.dtype | |
# io.imshow(base_image) | |
# io.show() | |
start = time() | |
local_otsu = rank.otsu(base_image, selem2) | |
print 'local otsu time: %0.2f seconds' % (time() - start) | |
# io.imshow(local_otsu) | |
# io.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment