This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 774 - umeyama sometimes returns a reflection
Summary: umeyama sometimes returns a reflection
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Geometry (show other bugs)
Version: 3.2
Hardware: All All
: Normal Unknown
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-27 20:34 UTC by Charles Karney
Modified: 2019-12-04 13:08 UTC (History)
4 users (show)



Attachments
Patch to umeyama to address reflection bug (1.07 KB, patch)
2014-03-27 20:34 UTC, Charles Karney
no flags Details | Diff

Description Charles Karney 2014-03-27 20:34:40 UTC
Created attachment 445 [details]
Patch to umeyama to address reflection bug

The following code

    const int m = 3;
    const int n = 3;
    Matrix<double, m, n> x, y;
    x <<
      0, 1,-1,
      0, 0, 0,
      0, 0, 0;
    y <<
      0,-1, 1,
      0, 0, 0,
      0, 0, 0;
    Matrix<double, m+1, m+1> ta = umeyama(x, y, false);

returns a matrix with a determinant of -1.  Umeyama's paper doesn't
properly explain how to deal with this case.  Basically everywhere he
says rank(AB^T) = m - 1, he means to say rank(AB^T) < m.  The attached
patch (against version 3.2.1) fixes this bug.  Note that I don't look at
the sign of determinant of sigma at all.  This is too subject to
errors.
Comment 1 totto 2016-02-09 14:27:17 UTC
I had the same problem of an unexpected reflection. Searching for the cause I found this bug report with the attached patch which fixed the issue.
Comment 2 Charles Karney 2016-02-09 16:51:47 UTC
You might be interested in bug 771 where I tried to do this fitting problem in a cleaner and more flexible manner.
Comment 3 Gael Guennebaud 2016-02-11 14:27:01 UTC
hm the original code is indeed very odd, and I agree with the proposed patch. (sorry for looking at it so lately).

Since we are at it, I don't see the point of this vector S full of ones... I'll remove it too.
Comment 4 Gael Guennebaud 2016-02-11 14:34:36 UTC
https://bitbucket.org/eigen/eigen/commits/1a74ed5ce5aa/
Summary:     Bug 774: fix a numerical issue producing unwanted reflections.
Comment 5 Nobody 2019-12-04 13:08:59 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/774.

Note You need to log in before you can comment on or make changes to this bug.