Fix inconsistencies in examples and many more improvements

This commit is contained in:
Johannes Schönberger
2013-04-27 16:47:33 +02:00
parent 41007b417b
commit d0ee6ade61
40 changed files with 138 additions and 132 deletions
+10 -8
View File
@@ -1,14 +1,16 @@
"""
=====================
====================
Local Otsu Threshold
=====================
This example shows how Otsu's threshold [1]_ method can be applied locally.
For each pixel, an "optimal" threshold is determined by maximizing the variance between two classes of pixels
of the local neighborhood defined by a structuring element.
====================
This example shows how Otsu's threshold [1]_ method can be applied locally. For
each pixel, an "optimal" threshold is determined by maximizing the variance
between two classes of pixels of the local neighborhood defined by a structuring
element.
The example compares the local threshold with the global threshold.
.. note: local threshold is much slower than global one.
.. note: local is much slower than global thresholding
.. [1] http://en.wikipedia.org/wiki/Otsu's_method
@@ -42,8 +44,8 @@ plt.xlabel('local Otsu ($radius=%d$)' % radius)
plt.colorbar()
plt.subplot(2, 2, 3)
plt.imshow(p8 >= loc_otsu, cmap=plt.cm.gray)
plt.xlabel('original>=local Otsu' % t_glob_otsu)
plt.xlabel('original >= local Otsu' % t_glob_otsu)
plt.subplot(2, 2, 4)
plt.imshow(glob_otsu, cmap=plt.cm.gray)
plt.xlabel('global Otsu ($t=%d$)' % t_glob_otsu)
plt.xlabel('global Otsu ($t = %d$)' % t_glob_otsu)
plt.show()