Adding X-Y axis into image file

Hi,
can anyone help me to add horizontal and vertical axis on the below image (dimension is 380*584 pix = 50* 77 mm)

 採用された回答

Image Analyst
Image Analyst 2020 年 7 月 12 日

1 投票

After you call imshow() call axis():
grayImage = imread('image.jpeg');
imshow(grayImage, [], 'XData', [0, 50], 'YData', [0, 77]);
axis('on', 'image');

4 件のコメント

MSK
MSK 2020 年 7 月 13 日
Hi, thank you for the support. Please could you tell me how to change my verticla axis from 0 to 77 instead of 77-0.
Image Analyst
Image Analyst 2020 年 7 月 13 日
I think it's
axis('xy'); % Origin at bottom left.
To get the origin at the upper left:
axis ij % Put origin at the upper left:
Image Analyst
Image Analyst 2020 年 7 月 13 日
編集済み: Image Analyst 2020 年 7 月 13 日
You can use flipud() on the variable as you pass it into imshow():
grayImage = imread('image.jpeg');
imshow(flipud(grayImage), [], 'XData', [0, 50], 'YData', [0, 77]);
axis('on', 'image', 'xy');
Or reverse the numbers for YData:
grayImage = imread('image.jpeg');
imshow(grayImage, [], 'XData', [0, 50], 'YData', [77, 0]);
axis('on', 'image', 'xy');
MSK
MSK 2020 年 7 月 13 日
Thanks a lot.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImage Processing Toolbox についてさらに検索

質問済み:

MSK
2020 年 7 月 12 日

コメント済み:

MSK
2020 年 7 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by