-2

I want to convert point (i.e 622,622) coordinates to other dimensional coordinates (622*1186) Using OpenCV. i.e I currently plotted the data at Image Size 640 * 640.

Now I want to plot it at 622*1186 Image size. I want to know the formula so that I can convert them. I am working with OpenCV.

1 Answers1

0

Ok, So I am answering my own Question!

The formula to convert the point (x, y) from the original size (width_original, height_original) to a new size (width_new, height_new) is:

x_new = x * width_new / width_original
y_new = y * height_new / height_original

So, in the above case:

x_new = 622 * 1186 / 640 = 622 * 1186 / 640 = 1176.25
y_new = 622 * 1186 / 640 = 622 * 1186 / 640 = 1176.25

So the new coordinates of the point would be (1176.25, 1176.25) in the 622 x 1186 image.