How do I scale coordinates for different image sizes?
9 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
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);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Read, Write, and Modify Image についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!