Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Translating coordinates of two pictures

I’m trying to translate coordinates from one picture (Res: 311, 271) to another picture (Res: 1920, 1080).

The coordinates don’t need to be accurate in the 2nd picture, it just needs to be the same vector relative to the center of the images

Don’t know if that makes sense…

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Edit:

So far I’ve tried to calculate the difference between the center of the first image and the coordinates and then apply them to the bigger image. However this doesn’t seem to work very consistently.

>Solution :

You’ll need to use trigonometry.

Say there’s some object in the image you’re trying to get the vector for. Given the x and y distances from the center of the original image, you can tabulate the angle and hypotenuse distance. Simply use the same angle and scale the hypotenuse distance with the new size image.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading