OpenSfM icon indicating copy to clipboard operation
OpenSfM copied to clipboard

it seems a bug in align_two_reconstruction

Open gaosanyuan opened this issue 4 years ago • 2 comments

It seems a bug here:

def align_two_reconstruction(r1, r2, common_tracks, threshold): """Estimate similarity transform between two reconstructions.""" t1, t2 = r1.points, r2.points

if len(common_tracks) > 6:

<<<<<<<<<<<<< p1 = np.array([t1[t[0]].coordinates for t in common_tracks]) p2 = np.array([t2[t[1]].coordinates for t in common_tracks]) <<<<<<<<<<<<<

I think it should be: p1 = np.array([t1[t].coordinates for t in common_tracks]) p2 = np.array([t2[t].coordinates for t in common_tracks]) here, t stands for the common shot id

    # 3 samples / 100 trials / 50% outliers = 0.99 probability
    # with probability = 1-(1-(1-outlier)^model)^trial
    T, inliers = multiview.fit_similarity_transform(
        p1, p2, max_iterations=100, threshold=threshold)
    if len(inliers) > 0:
        return True, T, inliers
return False, None, None

gaosanyuan avatar Jul 10 '20 11:07 gaosanyuan

Hi @gaosanyuan , this is a bug that we're going to address, thank you for reporting.

YanNoun avatar Mar 15 '21 10:03 YanNoun

Has this bug been addressed?

EliDavis3D avatar Sep 29 '22 15:09 EliDavis3D