Fix consecutive, Update default of retrieve_peaks
This commit is contained in:
parent
4e54a1b433
commit
ceaeccde3a
1 changed files with 3 additions and 1 deletions
4
utils.py
4
utils.py
|
@ -180,6 +180,8 @@ def consecutive( list_ ):
|
|||
"""
|
||||
if not isinstance( list_ , list ) and not isinstance( list_ , np.ndarray ):
|
||||
raise ValueError( 'list_ must be a list, ' + type( list_ ) + ' given' )
|
||||
if len( list_ ) == 0:
|
||||
return list_
|
||||
index = last_consecutive( list_ )
|
||||
if index == len( list_ ) - 1:
|
||||
return [ list_ ]
|
||||
|
@ -212,7 +214,7 @@ def rotate( image , angle ):
|
|||
cX , cY = ( width // 2 , height // 2 )
|
||||
matrix = cv2.getRotationMatrix2D( ( cX , cY ) , angle , 1 )
|
||||
return cv2.warpAffine( image , matrix , ( width , height ) , flags = cv2.INTER_NEAREST )
|
||||
def retrieve_peaks( data , window_size = 5 , error_coef = 1.05 , max_window_size = 30 , min_successive = 3 ):
|
||||
def retrieve_peaks( data , window_size = 5 , error_coef = 1.05 , max_window_size = 30 , min_successive = 2 ):
|
||||
"""
|
||||
get peak position from a 1D data
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue