MATLAB Answers

0

How do I scale coordinates for different image sizes?

Asked by The Imagician on 27 Jun 2018
Latest activity Answered by Ameer Hamza
on 27 Jun 2018
I have a set of [x,y] coordinates on a 900x600 image. How do I calculate the values of the coordinates on the same image but 500x500 in size?

  0 Comments

Sign in to comment.

1 Answer

Answer by Ameer Hamza
on 27 Jun 2018

You can use interp1() to linearly map the coordinates from old image size to new image size.
x_new = interp1([1 900], [1 500], x_old);
y_new = interp1([1 600], [1 500], y_old);

  0 Comments

Sign in to comment.