mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-03 03:11:05 +08:00
PEP8: fix indentation
This commit is contained in:
@@ -249,8 +249,8 @@ def maximum(image, selem, out=None, mask=None, shift_x=False, shift_y=False):
|
||||
|
||||
Note
|
||||
----
|
||||
* the lower algorithm complexity makes the rank.maximum() more efficient for
|
||||
larger images and structuring elements
|
||||
* the lower algorithm complexity makes the rank.maximum() more efficient
|
||||
for larger images and structuring elements
|
||||
|
||||
"""
|
||||
|
||||
@@ -299,7 +299,7 @@ def mean(image, selem, out=None, mask=None, shift_x=False, shift_y=False):
|
||||
|
||||
|
||||
def subtract_mean(image, selem, out=None, mask=None, shift_x=False,
|
||||
shift_y=False):
|
||||
shift_y=False):
|
||||
"""Return image subtracted from its local mean.
|
||||
|
||||
Parameters
|
||||
@@ -439,7 +439,7 @@ def modal(image, selem, out=None, mask=None, shift_x=False, shift_y=False):
|
||||
|
||||
|
||||
def enhance_contrast(image, selem, out=None, mask=None, shift_x=False,
|
||||
shift_y=False):
|
||||
shift_y=False):
|
||||
"""Enhance an image replacing each pixel by the local maximum if pixel
|
||||
greylevel is closest to maximimum than local minimum OR local minimum
|
||||
otherwise.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
__all__ = ['threshold_adaptive', 'threshold_otsu', 'threshold_yen']
|
||||
__all__ = ['threshold_adaptive', 'threshold_otsu', 'threshold_yen']
|
||||
|
||||
import numpy as np
|
||||
import scipy.ndimage
|
||||
@@ -65,7 +65,7 @@ def threshold_adaptive(image, block_size, method='gaussian', offset=0,
|
||||
thresh_image = np.zeros(image.shape, 'double')
|
||||
if method == 'generic':
|
||||
scipy.ndimage.generic_filter(image, param, block_size,
|
||||
output=thresh_image, mode=mode)
|
||||
output=thresh_image, mode=mode)
|
||||
elif method == 'gaussian':
|
||||
if param is None:
|
||||
# automatically determine sigma which covers > 99% of distribution
|
||||
@@ -73,17 +73,17 @@ def threshold_adaptive(image, block_size, method='gaussian', offset=0,
|
||||
else:
|
||||
sigma = param
|
||||
scipy.ndimage.gaussian_filter(image, sigma, output=thresh_image,
|
||||
mode=mode)
|
||||
mode=mode)
|
||||
elif method == 'mean':
|
||||
mask = 1. / block_size * np.ones((block_size,))
|
||||
# separation of filters to speedup convolution
|
||||
scipy.ndimage.convolve1d(image, mask, axis=0, output=thresh_image,
|
||||
mode=mode)
|
||||
mode=mode)
|
||||
scipy.ndimage.convolve1d(thresh_image, mask, axis=1,
|
||||
output=thresh_image, mode=mode)
|
||||
output=thresh_image, mode=mode)
|
||||
elif method == 'median':
|
||||
scipy.ndimage.median_filter(image, block_size, output=thresh_image,
|
||||
mode=mode)
|
||||
mode=mode)
|
||||
|
||||
return image > (thresh_image - offset)
|
||||
|
||||
@@ -146,7 +146,7 @@ def threshold_yen(image, nbins=256):
|
||||
nbins : int, optional
|
||||
Number of bins used to calculate histogram. This value is ignored for
|
||||
integer arrays.
|
||||
|
||||
|
||||
Returns
|
||||
-------
|
||||
threshold : float
|
||||
@@ -155,11 +155,11 @@ def threshold_yen(image, nbins=256):
|
||||
|
||||
References
|
||||
----------
|
||||
.. [1] Yen J.C., Chang F.J., and Chang S. (1995) "A New Criterion
|
||||
for Automatic Multilevel Thresholding" IEEE Trans. on Image
|
||||
.. [1] Yen J.C., Chang F.J., and Chang S. (1995) "A New Criterion
|
||||
for Automatic Multilevel Thresholding" IEEE Trans. on Image
|
||||
Processing, 4(3): 370-378
|
||||
.. [2] Sezgin M. and Sankur B. (2004) "Survey over Image Thresholding
|
||||
Techniques and Quantitative Performance Evaluation" Journal of
|
||||
.. [2] Sezgin M. and Sankur B. (2004) "Survey over Image Thresholding
|
||||
Techniques and Quantitative Performance Evaluation" Journal of
|
||||
Electronic Imaging, 13(1): 146-165,
|
||||
http://www.busim.ee.boun.edu.tr/~sankur/SankurFolder/Threshold_survey.pdf
|
||||
.. [3] ImageJ AutoThresholder code, http://fiji.sc/wiki/index.php/Auto_Threshold
|
||||
|
||||
@@ -116,7 +116,7 @@ def find_contours(array, level,
|
||||
raise ValueError('Parameters "fully_connected" and'
|
||||
' "positive_orientation" must be either "high" or "low".')
|
||||
point_list = _find_contours.iterate_and_store(array, level,
|
||||
fully_connected == 'high')
|
||||
fully_connected == 'high')
|
||||
contours = _assemble_contours(_take_2(point_list))
|
||||
if positive_orientation == 'high':
|
||||
contours = [c[::-1] for c in contours]
|
||||
|
||||
Reference in New Issue
Block a user