How do I change the resolution of an image produced by imagesc?

27 次查看(过去 30 天)
How can I change the resolution of the image part of the figure produced by imagesc? I was going to try using imresize but I can't figure out how to make it work. I'm trying to purposefully reduce the quality of a data set as part of a simulation.
  1 个评论
Ross Brain
Ross Brain 2015-4-11
For those curious what I'm doing, I'm using data from the Leiden/Dwingeloo sky survey of galactic neutral hydrogen to predict the output of the little SRT we have at the university but there's a resolution difference. The data straight from the survey looks like:
And the data from our SRT (I didn't take it, I know it's awful) looks like:
So with some blurring and now successfully having compressed the image to the same resolution, my simulation looks like:
Still obviously some work to go, but it may interest some.

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2015-4-10
If you use imresize() to shrink your image, but it is still bigger than the axes on your screen (for example a 500 by 700 image is being shown on 200 by 300 pixels on your screen, then you will not notice any difference upon display, but you will if you look at the actual variable in the variable inspector. Is that what is happening?
See my Zoom demo, attached. Actually it's an adapted demo personally given to me by the imaging team at the Mathworks.
  1 个评论
Ross Brain
Ross Brain 2015-4-11
I worked out my own mistake. I didn't realise that I could just use imresize on the matrix I was putting into imagesc. For info on what I was trying to do look at my own comment under the question.

请先登录,再进行评论。

更多回答(1 个)

Chris McComb
Chris McComb 2015-4-10
To use imresize, you first read the image in:
a = imread('image.jpg');
Then, you apply imresize as follows (for example to reduce resolution by 50%):
b = imresize(a, 0.5);
Your reduced image is stored to b.
  1 个评论
Ross Brain
Ross Brain 2015-4-11
My image is stored as an array, which I use imagesc to visualise. This is the image I need to resize so it's not stored anywhere to load in.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by