Scaling an image then overlaying data on top of it

5 ビュー (過去 30 日間)
Josh Tome
Josh Tome 2022 年 11 月 4 日
コメント済み: Matt J 2022 年 11 月 4 日
Hello,
I am attempting to plot some xy data over an image (see attached image). The data I would like to plot (see attached excel file) is a subset of data that contains values of x ranging from (199 to 223), and values of y ranging from (-321 to -298). I also know the xy locations of each of the 4 corners of my image. They would be...
Top Left Corner(x,y) = (4.6,-197.5)
Top Right Corner(x,y) = (397.0,-197.5)
Bottom Left Corner(x,y) = (4.6,-412.9)
Bottom Right Corner(x,y) = (397.0,-412.9)
Is there an easy way to scale the image based on the above corner points so that when I plot the data it is all contained within the boundaries of the image?
Thanks in advance!
  1 件のコメント
Josh Tome
Josh Tome 2022 年 11 月 4 日
CORRECTION... When I said "I know the xy locations of the corners of my image", I should have said that those are the coordinates I would like the corners of the image to be defined by.

サインインしてコメントする。

採用された回答

Matt J
Matt J 2022 年 11 月 4 日
編集済み: Matt J 2022 年 11 月 4 日
[X,Y]=readvars('Center of Pressure Data.xlsx');
Y=-Y;
h=imshow(flipud(imread('Overhead View of Human.jpg')),[]);
h.XData=[4.6,397]; xlim(h.XData);
h.YData=[197.5,412.9]; ylim(h.YData);
hold on; scatter(X,Y); hold off
  2 件のコメント
Josh Tome
Josh Tome 2022 年 11 月 4 日
Awesome! Thanks for the speedy reply.
Matt J
Matt J 2022 年 11 月 4 日
You're very welcome, but if you are satisfied with the answer, please Accept-click it.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRead, Write, and Modify Image についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by