Derive parameters from transform matrix

Click For Summary

Discussion Overview

The discussion revolves around deriving transformation parameters from a given transform matrix related to image processing, specifically for images that have undergone rotation, translation, and scaling. Participants explore the relationships between the matrix elements and the corresponding transformation parameters.

Discussion Character

  • Technical explanation, Conceptual clarification, Debate/contested

Main Points Raised

  • One participant presents a transform matrix and attempts to derive translation, rotation, and scale parameters from it.
  • Another participant requests clarification on the meaning of the matrix elements (a through f) and their roles in the transformation.
  • A participant explains the linear transformation equations and how the matrix elements relate to translation, rotation, and magnification.
  • One participant challenges the accuracy of the initial parameter values, suggesting that some values should be zero and others should be specific numbers based on their understanding.
  • Another participant expresses uncertainty about the source of the initial values and questions their validity based on the referenced utility for astronomical image processing.
  • A later reply highlights the importance of the center of rotation in determining the translation values, indicating that the initial assumption about the center being at the image center was incorrect.
  • The original poster acknowledges their mistake regarding the center of rotation and reports success in deriving the correct parameters after adjusting their approach.

Areas of Agreement / Disagreement

Participants express differing views on the correctness of the initial parameter values and the implications of the center of rotation, leading to a lack of consensus on the initial calculations. However, there is agreement on the importance of understanding the transformation matrix's components.

Contextual Notes

Some assumptions about the center of rotation and the nature of the transformation may not have been clearly defined, leading to confusion in deriving the translation parameters.

lock042
Messages
4
Reaction score
0
Hello everybody,
Sorry to ask you something that may be easy for you but I'm stuck.
For example I have 2 images (size 2056x2056). One image of reference and the other is the same rotated from -90degrees.
Using a program with keypoints, it gives me a transform matrix :
a=2.056884522e+03 b=1.153333964e-04 c=-9.999797329e-01
d=1.767228039e-01 e=9.998105577e-01 f=4.144966751e-06.

Now I try to recover the transform parameters : translation, rotation and scale.
For rotation I have :
θ = atan2(c, b) = -89.99
For scale :
scale = sqrt(b * b + c * c) = 1.0

But for translation I'm stuck.
In a system transformation where rotation is negligeable, it's easy because a and d describe the translation between the two systems with dx = a and dy = -d but here, it is not negligeable and I should find
dx = 0.0
dy = 0.0

Could you help me ?lock
 
Last edited:
Science news on Phys.org
Welcome to the forum.

I am not familiar with the system you are using. Could you explain a bit what the variables a through f are about? Maybe you could give a little context.
 
Hello, thanks for trying to help me.
This is a linear transformation between coordinates (x, y) and (x', y'):

x' = A + Bx + Cy
y' = D + Ex + Fy

a, d: describe the translation between the two systems
b,c,d,e: describe rotation and magnification

magnification = sqrt(b*b + c*c);
rotation angle = atan(c/b);

The images contains stars and transformation is computed thanks to these stars.

It is about all I know on the matrix I gave you, this is why it is difficult for me
 
Last edited:
I think your A and D are wrong by a lot. Your B and F are off a little. Your C and E seem to be pretty close.

You should be getting something like A, D, B, and F are all zero, C should be -1, E should be 1.

Maybe your calculation does not deal with 90 degree angles correctly. How did you get these values?
 
lock042 said:
I should find
dx = 0.0
dy = 0.0
If the rotation is around the image center, then the translation of the origin in a corner is certainly not zero.
 
lock042 said:
I assume that the values are correct. They are given by : http://spiff.rit.edu/match/match-0.16/match.html

The page you cite seems to be describing a utility to detect scaling, translation, and rotation of astronomical images. It's an interesting problem because two astronomical images do not necessarily come with the same magnification, orientation, or centre.

The values you quoted in your first post are not in the link you gave. For example, nowhere on that page will you find 2.05, nor 1.1. So it's unclear where you got these numbers.

Also, it would seem that by "rotated from -90degrees" you meant scaled, rotated, and translated from the original set of coordinates. I presumed you meant rotated by 90 degrees. I was wrong. You meant transformed by some arbitrary amount in each of these three different fashions.

It looks like you can just read off the translation. They are the A and D values. If it was pure translation, no rotation and no scale, then B and F would be 1, C and E would be 0. And A and D would be pure translation. With B, C, E, and F values other than that, it is a scale and rotation followed by a translation by the values of A and D.
 
Hello.

Thanks for your answers.
I've found my mistakes. In fact, I was just forgetting the position of the center of rotation. I was (stupidly) thinking it was in the center of the image in the algorithm I gave you. But it was not the case.
Taking the center of rotation at the bottom left gave me good results :D.

Thanks for your answers,
I appreciate your kindness.
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 18 ·
Replies
18
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 16 ·
Replies
16
Views
5K