# Applying the same translation to images of varying size

This topic is 3311 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have a 1600 x 1200 image, and a 400x300 version of the same. I applied translation(tx,ty) to the 1600x1200 image. To apply the corresponding translation to the 400x300 image, I just changed the translation to: (tx/4 , ty/4) as the smaller is 1/4th the size. (1) Is that assumption correct? Also, if the post-translation origin for the big image is (ox,oy), (2) would the post-translation origin for the small image be (ox/4,oy/4) along the same lines? Thanks a lot, Abhi [Edited by - aseg on June 18, 2009 4:29:12 PM]

##### Share on other sites
I may be misintepreting what your after, but i dont think size comes into it...

In that if i translate an object (5,-5) it will move 5 units up, and 5 units left no matter the size if the reference point stays the same.

So object 1's origin is 0,0 and object 2's origin is also 0,0... the translation will move both objects to be the same origin points.

If you were to change the screen resolution at this point however, then i would say your logic would hold.

In that object 1's origin on a 1600x1200 screen could be 0,0... object 2's origin on a 400x300 screen could be 0,0... moving both images relative to the screen size would require a scaled translation. Object 1 would need to move 800,600 to have the origin in the centre of the screen while object 2 would need to move 200,150 (your scale of 4 that you have referred to.)

##### Share on other sites
I will try another approach, as I haven't fully understood what you're after.

When you apply a translation of (tx,ty) over the 1600x1200 image, you move a certain percentage of the image, in this case, tx/1600 and ty/1200. Think about normalized coordinates. Map you 1600x1200 image to a quad of know and common width and height. By your example, a 4x3 quad:
            (1600,1200)                        (4,3)      *-------*                        *--------*      |       |            =>          |        |      |       |                        |        |(0,0) *-------*                  (0,0) *--------*

That way, take your image and whenever you say translate(.5,.5), it'll be the same on any image you have. So, for your points:
Quote:
 (1) Is that assumption correct?
Yes
Quote:
 (2) would the post-translation origin for the small image be (ox/4,oy/4) along the same lines?
I did not understand what you are asking

1. 1
2. 2
Rutin
19
3. 3
JoeJ
16
4. 4
5. 5

• 34
• 23
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631701
• Total Posts
3001807
×