result2 = np.reshape(result, result.shape[0] * result.shape[1])
sort = np.argsort(result2)
y1, x1 = np.unravel_index(sort[0], result.shape)
y2, x2 = np.unravel_index(sort[1], result.shape)
opencv python MatchTemplate function with multiple matches