This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 1304 - Axis-Aligned Scaling incorrect on Projective Transforms
Summary: Axis-Aligned Scaling incorrect on Projective Transforms
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Geometry (show other bugs)
Version: unspecified
Hardware: All All
: Normal Wrong Result
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-23 01:01 UTC by Stephen Kiazyk
Modified: 2019-12-04 16:17 UTC (History)
4 users (show)



Attachments
Compile this file with Eigen on the include search path. Then run on the command line (996 bytes, text/x-c++src)
2016-09-23 01:01 UTC, Stephen Kiazyk
no flags Details

Description Stephen Kiazyk 2016-09-23 01:01:37 UTC
Created attachment 736 [details]
Compile this file with Eigen on the include search path. Then run on the command line

When applying an axis-aligned scale (using `DiagonalMatrix`) to a `Transform` object whose `Mode` template argument is set to `Projective`, and whose lowest row elements are non-zero, the result is incorrect. That is, the scaling will not be applied to the elements in the final row. I'm assuming this is just a mis-assumption about the matrix, since this is technically correct for an `Affine` transform type.

Attached is an example demonstrating this. If I apply the `DiagonalMatrix` directly to a particular `Transform`, I get a different result than if I convert the `DiagonalMatrix` to a `Transform`, and then apply it to the same transform as before, I get different results.

I don't think this should be terribly difficult to solve, and if I have the time, I might look into fixing it, I'm just unfamiliar with the internals of Eigen, so I'm sure someone with a little more familiarity could solve it in a few minutes.

This file should compile with the following (with /usr/local/include/eigen3 replaced with whatever your install dir for Eigen is):

```
g++ -I/usr/local/include/eigen3 eigen_diagonal_affine_scale_problem.cpp -o eigen_diagonal_affine_scale_problem
```

And run with:

```
./eigen_diagonal_affine_scale_problem
```

I have only tested this on Linux so far, however I doubt it wouldn't show up on any other platform.

Thanks,
- Stephen Kiazyk
Comment 1 Gael Guennebaud 2016-09-23 11:45:27 UTC
Thank you for catching that one. Fixed:

https://bitbucket.org/eigen/eigen/commits/f6382682565c/
Summary:     Bug 1304: fix Projective * scaling and Projective *= scaling

Backport to 3.2:
https://bitbucket.org/eigen/eigen/commits/dbfa374262c9/
Comment 2 Nobody 2019-12-04 16:17:46 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/1304.

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