Issue with g-input: as I click on an image from north to south, the y values are positive values that progressively get larger and larger

1 回表示 (過去 30 日間)
Hello,
I have a pressing issue here about g-input. it on an image that I have loaded, the more south of the picture I click, the more larger and positive values of y I get. I'd appreciate it if someone would let me know why this happens. Thank you.

採用された回答

Geoff Hayes
Geoff Hayes 2019 年 3 月 10 日
Arian - the pixel in the top left corner of the image corresponds to the first row and first column of your image (matrix). So if you navigate down (south) in the image, the row number (along the y-axis) will increase.
  3 件のコメント
Geoff Hayes
Geoff Hayes 2019 年 3 月 10 日
You may have to do that transformation yourself...
Arian Kolahi Sohrabi
Arian Kolahi Sohrabi 2019 年 3 月 10 日
Got it. Thank you. For now, I set my final y value to be -(the y from the input).

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2019 年 3 月 10 日
The axes YDir property is set to 'reverse' by imshow() and image() and imagesc() unless hold on is in effect.
This is done so that the first row and column of the array of data corresponds to the upper left of the displayed image, as people tend to find that easier for images than the normal convention that lower y coordinates should occur near the bottom.
  3 件のコメント
Walter Roberson
Walter Roberson 2019 年 3 月 10 日
No. What you can do is
set(gca, 'YDir', 'normal')

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

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by