diff --git a/utils.py b/utils.py index 47e61e7..bf0a33f 100644 --- a/utils.py +++ b/utils.py @@ -191,6 +191,7 @@ def last_consecutive( list_ ): if not isinstance( list_ , list ) and not isinstance( list_ , np.ndarray ): raise ValueError( 'list_ must be a list, ' + type( list_ ) + ' given' ) first , lower , greater = list_[0] , 0 , len( list_ ) + i = lower + ( greater - lower ) // 2 while greater - lower != 1: i = lower + ( greater - lower ) // 2 if list_[ i ] - first != i: # outside of the consecutive list @@ -210,4 +211,4 @@ def rotate( image , angle ): height , width = image.shape[ : 2 ] cX , cY = ( width // 2 , height // 2 ) matrix = cv2.getRotationMatrix2D( ( cX , cY ) , angle , 1 ) - return cv2.warpAffine( image , matrix , ( width , height ) , flags = cv2.INTER_LINEAR ) + return cv2.warpAffine( image , matrix , ( width , height ) , flags = cv2.INTER_NEAREST )