added get_local_maxima to feature

This commit is contained in:
Vighnesh Birodkar
2014-03-06 13:04:09 +05:30
parent 7681598380
commit 579c3d5aa3
2 changed files with 13 additions and 2 deletions
+3 -2
View File
@@ -14,7 +14,7 @@ from .censure import CENSURE
from .orb import ORB
from .match import match_descriptors
from .util import plot_matches
from .blob import blob_dog
from .blob import blob_dog, get_local_maxima
__all__ = ['daisy',
@@ -42,4 +42,5 @@ __all__ = ['daisy',
'ORB',
'match_descriptors',
'plot_matches',
'blob_dog']
'blob_dog',
'get_local_maxima']
+10
View File
@@ -41,6 +41,16 @@ def get_local_maxima(ar, threshold, connectivity=3):
A 2d array in which each row contains 3 values, the indices of local
maxima.
Examples
--------
>>> a = np.array([[ 0 , 0 , 0 , 0 , 0],
... [ 0 , 0 , 3 , 0 , 0],
... [ 0 , 0 , 1 , 0 , 0],
... [ 0 , 1 , 0 , 0 , 0],
... [ 0 , 0 , 0 , 0 , 0]])
>>> get_local_maxima(a, threshold = 1, connectivity = 2)
array([[1, 2]])
"""
# computing max filter using all neighbors in cube
fp = generate_binary_structure(ar.ndim, connectivity)