Skip to content

Problems with find_registration #1271

@janden

Description

@janden

There appear to be two (unrelated) issues with Rotation.find_registration (which is used by Rotation.register). The first is that the way it chooses whether to apply J-conjugation doesn't seem to work. Indeed, if we compare the errors induced by the two rotation matrices Q1 and Q2 on the full loss function, these are not always in the same order as err1 and err2 (in other words, the proxy of looking at Q1 @ Q1.T and Q2 @ Q2.T looks incorrect). It works if there is an exact solution (that is, the matrices are rotations of one another and the loss function reaches zero), but not in the general case.

The second issue is that the Q matrix return is sometimes not a pure rotation (i.e., has determinant negative one).

The following script demonstrates both problems:

import numpy as np
from aspire.utils import Rotation

angs_true = np.load("angs_true.npy")
#angs_est01 = np.load("angs_est01.npy")
angs_est02 = np.load("angs_est02.npy")

rots_true = Rotation.from_euler(angs_true)
#rots_est01 = Rotation.from_euler(angs_est01)
rots_est02 = Rotation.from_euler(angs_est02)

#Q, flag = rots_est01.find_registration(rots_true)

#print(flag)                 # should be 0

Q, flag = rots_est02.find_registration(rots_true)

print(np.linalg.det(Q))     # should be >0

Data files are here: data.zip

EDIT: Test doesn't trigger issue with J-conjuacy. Updated angs_est02.npy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions