Small additions to some docstrings in exposure module

This commit is contained in:
emmanuelle
2014-12-01 23:32:21 +01:00
parent 6c444490e3
commit 2636abba92
+40
View File
@@ -44,6 +44,10 @@ def histogram(image, nbins=256):
bin_centers : array
The values at the center of the bins.
See also
--------
cumulative_distribution
Examples
--------
>>> from skimage import data, exposure, util
@@ -102,10 +106,22 @@ def cumulative_distribution(image, nbins=256):
bin_centers : array
Centers of bins.
See also
--------
histogram
References
----------
.. [1] http://en.wikipedia.org/wiki/Cumulative_distribution_function
Examples
--------
>>> from skimage import data, exposure, util
>>> image = util.img_as_float(data.camera())
>>> hi = exposure.histogram(image)
>>> cdf = exposure.cumulative_distribution(image)
>>> np.alltrue(cdf[0] == np.cumsum(hi[0])/float(image.size))
True
"""
hist, bin_centers = histogram(image, nbins)
img_cdf = hist.cumsum()
@@ -225,6 +241,10 @@ def rescale_intensity(image, in_range='image', out_range='dtype'):
Image array after rescaling its intensity. This image is the same dtype
as the input image.
See also
--------
intensity_range, equalize_hist
Examples
--------
By default, the min/max intensities of the input image are stretched to
@@ -315,6 +335,10 @@ def adjust_gamma(image, gamma=1, gain=1):
out : ndarray
Gamma corrected output image.
See also
--------
adjust_log
Notes
-----
For gamma greater than 1, the histogram will shift towards left and
@@ -327,6 +351,14 @@ def adjust_gamma(image, gamma=1, gain=1):
----------
.. [1] http://en.wikipedia.org/wiki/Gamma_correction
Examples
--------
>>> from skimage import data, exposure, util
>>> image = util.img_as_float(data.moon())
>>> gamma_corrected = exposure.adjust_gamma(image, 2)
>>> # Output is darker for gamma > 1
>>> image.mean(), gamma_corrected.mean()
(0.43988067028574979, 0.19622774786391453)
"""
_assert_non_negative(image)
dtype = image.dtype.type
@@ -362,6 +394,10 @@ def adjust_log(image, gain=1, inv=False):
out : ndarray
Logarithm corrected output image.
See also
--------
adjust_gamma
References
----------
.. [1] http://www.ece.ucsb.edu/Faculty/Manjunath/courses/ece178W03/EnhancePart1.pdf
@@ -405,6 +441,10 @@ def adjust_sigmoid(image, cutoff=0.5, gain=10, inv=False):
out : ndarray
Sigmoid corrected output image.
See also
--------
adjust_gamma
References
----------
.. [1] Gustav J. Braun, "Image Lightness Rescaling Using Sigmoidal Contrast