def match_twosided(desc1, desc2, threshold=0.5):
 matches_12 = match(desc1, desc2, threshold)
 matches_21 = match(desc2, desc1, threshold)
 ndx_12 = where((matches_12 >= 0))[0]
 for n in ndx_12:
  if (matches_21[matches_12[n]] != n):
   matches_12[n] = (-1)
 return matches_12

def match_twosided ( desc1 , desc2 , threshold = 0.5 ) : matches_12 = match ( desc1 , desc2 , threshold ) matches_21 = match ( desc2 , desc1 , threshold ) ndx_12 = where ( ( matches_12 >= 0 ) ) [ 0 ] for n in ndx_12 : if ( matches_21 [ matches_12 [ n ] ] != n ) : matches_12 [ n ] = ( - 1 ) return matches_12
two-sided symmetric version of match() .