B The mathematics of transforming images in Adobe Premiere - Part 1

guyburns
Messages
42
Reaction score
10
There will be a Part 2 about a related mathematical problem.

I use Premiere to generate updated versions of old-fashioned slide shows. Not much video is involved, mostly stills that I transform to bring them alive – pans, zooms, rotations.

The Mathematics
In Premiere, an image appears in what I'll call the Window. Six parameters define the appearance: Position X, Position Y, Scale, Rotation, Anchor X, Anchor Y.

For my shows, the Window is set to 1920 x 1080 pixels. Let's say the image is 3000 x 1500 pixels. When the image is imported, the centre of the image appears in the centre of the Window. Here's what the parameters control, and here are the values automatically set for such an image when imported:

Position X = 960 This is where the horizontal centre of the image will be placed in the Window.
Position Y = 540 Ditto for the vertical centre of the image.
Scale = 100 Scaling (centred on the Anchor points)
Rotation = 0 Rotation (centred on the Anchor Points)
Anchor X = 1500 The point of the image which appears stationary under scaling and rotation.
Anchor Y = 750 Ditto

Shorten the above to PX, PY, S, R, AX, AY.
For a 3000 x 1500 image, only the central 1920x1080 part of it will appear in the Window. It can then be moved, scaled and rotated.

Question
Given an image anchored at a particular place with these parameters (PX1, PY1, S, R, AX1, AY1), and then I change the Anchor Point to (AX2, AY2), how do I calculate PX2 and PY2 so the image appears unchanged on screen?

When I change the Anchor Point, the image will abruptly move, but I want to bring it back to where it was by adjusting PX2 and PY2. I can do it by eye, but it takes time and is never exact.

Is there a general formula for PX2 and PY2 in terms of PX1, PY1, AX1, AY1, AX2, AY2?
Assume S and R are constant.

PX2 = ?
PY2 = ?
 
Mathematics news on Phys.org
Without rotation or scaling, I think you want (PX2, PY2) to be in the same position relative to (AX2, AY2) as (PX1,PY1) is to (AX1,AX2). Thus PX2 - AX2 = PX1 - AX1 so that PX2 = PX2 + AX2 - AX1, and a similar epression for PY2.

With rotation or scaling a similar principle applies, so that (PX2,PY2) is in the same position relative to (AX2,AY2) as the image of (PX1,PY1) under rotation or scaling about (AX1,AY1) is to (AX1,AY1).
 
Hey, thanks for that. I just tried it in Premier and it works, except you made a typo. The formula should have been PX2 = PX1 + AX2 - AX1.

And following your suggestion, for scaling (S in percent) I have come up with the formulaes:
PX2 = PX1 + (AX2 - AX1) • S/100
PY2 = PY1 + (AY2 - AY1) • S/100

And they seem to work. Thanks a lot.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
I'm interested to know whether the equation $$1 = 2 - \frac{1}{2 - \frac{1}{2 - \cdots}}$$ is true or not. It can be shown easily that if the continued fraction converges, it cannot converge to anything else than 1. It seems that if the continued fraction converges, the convergence is very slow. The apparent slowness of the convergence makes it difficult to estimate the presence of true convergence numerically. At the moment I don't know whether this converges or not.

Similar threads

Replies
1
Views
348
Replies
6
Views
3K
Replies
2
Views
3K
Replies
2
Views
4K
Back
Top