@@ -328,7 +328,7 @@ def _resolve_neighborhood(selem, connectivity, ndim):
328
328
return selem
329
329
330
330
331
- def local_maxima (image , connectivity = None , selem = None , indices = False ,
331
+ def local_maxima (image , selem = None , connectivity = None , indices = False ,
332
332
allow_borders = True ):
333
333
"""Find local maxima of n-dimensional array.
334
334
@@ -340,16 +340,16 @@ def local_maxima(image, connectivity=None, selem=None, indices=False,
340
340
----------
341
341
image : ndarray
342
342
An n-dimensional array.
343
+ selem : ndarray, optional
344
+ A structuring element used to determine the neighborhood of each
345
+ evaluated pixel. It must only contain 1's and 0's, have the same number
346
+ of dimensions as `image`. If not given, all adjacent pixels are
347
+ considered as part of the neighborhood.
343
348
connectivity : int, optional
344
349
A number used to determine the neighborhood of each evaluated pixel.
345
350
Adjacent pixels whose squared distance from the center is larger or
346
- equal to `connectivity` are considered neighbors. If not given, all
347
- adjacent pixels are considered as part of the neighborhood. Ignored if
351
+ equal to `connectivity` are considered neighbors. Ignored if
348
352
`selem` is not None.
349
- selem : ndarray, optional
350
- A structuring element used to determine the neighborhood of each
351
- evaluated pixel. It must only contain 1's and 0's, have the same number
352
- of dimensions as `image`.
353
353
indices : bool, optional
354
354
If True, the output will be an array representing indices of local
355
355
maxima. If False, the output will be an array of 0's and 1's with the
@@ -468,7 +468,7 @@ def local_maxima(image, connectivity=None, selem=None, indices=False,
468
468
return flags
469
469
470
470
471
- def local_minima (image , connectivity = None , selem = None , indices = False ,
471
+ def local_minima (image , selem = None , connectivity = None , indices = False ,
472
472
allow_borders = True ):
473
473
"""Find local minima of n-dimensional array.
474
474
@@ -480,16 +480,16 @@ def local_minima(image, connectivity=None, selem=None, indices=False,
480
480
----------
481
481
image : ndarray
482
482
An n-dimensional array.
483
+ selem : ndarray, optional
484
+ A structuring element used to determine the neighborhood of each
485
+ evaluated pixel. It must only contain 1's and 0's, have the same number
486
+ of dimensions as `image`. If not given, all adjacent pixels are
487
+ considered as part of the neighborhood.
483
488
connectivity : int, optional
484
489
A number used to determine the neighborhood of each evaluated pixel.
485
490
Adjacent pixels whose squared distance from the center is larger or
486
- equal to `connectivity` are considered neighbors. If not given, all
487
- adjacent pixels are considered as part of the neighborhood. Ignored if
491
+ equal to `connectivity` are considered neighbors. Ignored if
488
492
`selem` is not None.
489
- selem : ndarray, optional
490
- A structuring element used to determine the neighborhood of each
491
- evaluated pixel. It must only contain 1's and 0's, have the same number
492
- of dimensions as `image`.
493
493
indices : bool, optional
494
494
If True, the output will be an array representing indices of local
495
495
minima. If False, the output will be an array of 0's and 1's with the
@@ -568,8 +568,8 @@ def local_minima(image, connectivity=None, selem=None, indices=False,
568
568
"""
569
569
return local_maxima (
570
570
image = invert (image ),
571
- connectivity = connectivity ,
572
571
selem = selem ,
572
+ connectivity = connectivity ,
573
573
indices = indices ,
574
574
allow_borders = allow_borders
575
575
)
0 commit comments