def sieve_matches_lowe(matches):
    """Apply Lowe's ratio test to retain only good matches.

    Args:
        matches: (list of cv2.DMatch): Matched descriptors.

    Returns:
        (list of cv2.DMatch): Matched descriptors that passed the test.
    """
    good_matches = []
    for m, n in matches:
        if m.distance < n.distance * 0.8:
            good_matches.append(m)

    return good_matches