3.3.9.7. Otsu thresholding — Scipy lecture notes
scipy-lectures.org › plot_thresholdimport matplotlib.pyplot as plt from skimage import data from skimage import filters from skimage import exposure camera = data.camera() val = filters.threshold_otsu(camera) hist, bins_center = exposure.histogram(camera) plt.figure(figsize=(9, 4)) plt.subplot(131) plt.imshow(camera, cmap='gray', interpolation='nearest') plt.axis('off') …