How do I scale coordinates for different image sizes?

조회 수: 3 (최근 30일)
The Imagician
The Imagician 2018년 6월 27일
답변: Ameer Hamza 2018년 6월 27일
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?

답변 (1개)

Ameer Hamza
Ameer Hamza 2018년 6월 27일
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);

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by