(pos, pos_new_f, best_pos_f, best_dist, feat1, feat2, feat1_, feat2_, psize=2)
Return the best b position and corresponding distance
    Params:
        pos(2):position for update
        pos_f(2): new_position in b for update
        best_pos_f(2): best pos now
        best_dist(1): best distance now
        feat*(H*W*C): features
Return the best b position and corresponding distance
    Params:
        pos(2):position for update
        pos_f(2): new_position in b for update
        best_pos_f(2): best pos now
        best_dist(1): best distance now
        feat*(H*W*C): features
Return the best b position and corresponding distance Params : pos ( 2 ) : position for update pos_f ( 2 ) : new_position in b for update best_pos_f ( 2 ) : best pos now best_dist ( 1 ) : best distance now feat * ( H * W * C ) : features
def improve_guess(pos, pos_new_f, best_pos_f, best_dist, feat1, feat2, feat1_, feat2_, psize=2):
    """
    Return the best b position and corresponding distance
    Params:
        pos(2):position for update
        pos_f(2): new_position in b for update
        best_pos_f(2): best pos now
        best_dist(1): best distance now
        feat*(H*W*C): features
    """
    #print(best_dist)
    new_dist = feat_patch_distance(feat1, feat2, feat1_, feat2_, pos, pos_new_f, psize)
    if new_dist < best_dist:
        return pos_new_f, new_dist
    else:
        return best_pos_f, best_dist
def improve_guess ( pos , pos_new_f , best_pos_f , best_dist , feat1 , feat2 , feat1_ , feat2_ , psize = 2 ) : #print(best_dist) new_dist = feat_patch_distance ( feat1 , feat2 , feat1_ , feat2_ , pos , pos_new_f , psize ) if new_dist < best_dist : return pos_new_f , new_dist else : return best_pos_f , best_dist