def local_binary_pattern(image, P, R, method='default'):
 assert_nD(image, 2)
 methods = {'default': ord('D'), 'ror': ord('R'), 'uniform': ord('U'), 'nri_uniform': ord('N'), 'var': ord('V')}
 image = np.ascontiguousarray(image, dtype=np.double)
 output = _local_binary_pattern(image, P, R, methods[method.lower()])
 return output

def local_binary_pattern ( image , P , R , method = 'default' ) : assert_nD ( image , 2 ) methods = { 'default' : ord ( 'D' ) , 'ror' : ord ( 'R' ) , 'uniform' : ord ( 'U' ) , 'nri_uniform' : ord ( 'N' ) , 'var' : ord ( 'V' ) } image = np . ascontiguousarray ( image , dtype = np . double ) output = _local_binary_pattern ( image , P , R , methods [ method . lower ( ) ] ) return output
gray scale and rotation invariant lbp .