フィルターのクリア

How to resize an image without changing the image display?

1 回表示 (過去 30 日間)
Taoooooooooooo
Taoooooooooooo 2019 年 8 月 7 日
コメント済み: Taoooooooooooo 2019 年 8 月 8 日
Hi All,
I am wondering how to resize an image w/o changing the shape of the image: e.g if an image matrix is 256x256, and lets say I want to resize it to 256x10000 but the image display will look really compressed. Is it possible for me to only change the size of the image but the image display still looks like 256x256?
Sincerely,
Tao
  1 件のコメント
awezmm
awezmm 2019 年 8 月 8 日
編集済み: awezmm 2019 年 8 月 8 日
Do you wish to add padding on the image?

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

採用された回答

Walter Roberson
Walter Roberson 2019 年 8 月 8 日
If you use image() or imagesc() or imshow(), you can pass in parameters 'XData' and 'YData' that determine where the image is to be drawn on the axes in terms of data coordinates. The center of the lower left pixel is placed at x = XData(1), y = YData(1), and the center of the upper right pixel is placed at x = XData(2), y = YData(2). If you happened to have an axes that is set to "axis equal" (that is, axis DataAspectRatio = [1 1 1]), then you could do something like
imshow(YourBigImage, 'XData', [1 256], 'YData', [1 256])
and then YourBigImage that is 256 x 10000 would be squeezed onto the display into x = 1 to 256, y = 1 to 256
  1 件のコメント
Taoooooooooooo
Taoooooooooooo 2019 年 8 月 8 日
Thank you for answering my question. I just realized that if I use imagesc([Xmin Xmax],[Ymin Ymax], Image) can achieve what I wanted.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by