Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
image() and imshow()

Subject: image() and imshow()

From: Vihang Patil

Date: 19 Jan, 2008 15:13:03

Message: 1 of 8

Hello
If I use the
figure;
imshow(<pic>);
I see that the figure window automatically modifies itself
so that the pictures aspect ratio are preserved and the
image doesnot look stretched out or it does not
necessarily fill the axis created intially by the figure
window. I get the image shown in its true aspect ratio and
resolution.But, if I use the ;
figure;
image(<pic>);
I see that the picture accomodates itself in the figures
axis and the aspect ratio and the original resolution is
lost.
How can we make the image() imitate the imshow()
Thanks
Vihang

Subject: image() and imshow()

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 19 Jan, 2008 16:00:38

Message: 2 of 8

In article <fmt41v$pjo$1@fred.mathworks.com>,
Vihang Patil <vihang_patil@yahoo.com> wrote:

>resolution.But, if I use the ;
>figure;
>image(<pic>);
>I see that the picture accomodates itself in the figures
>axis and the aspect ratio and the original resolution is
>lost.
>How can we make the image() imitate the imshow()

axis equal
--
We regret to announce that sub-millibarn resolution bio-hyperdimensional
plasmatic space polyimaging has been delayed until the release
of Windows Vista SP2.

Subject: image() and imshow()

From: Vihang Patil

Date: 19 Jan, 2008 16:41:02

Message: 3 of 8


> axis equal
> --

Dear Walter
This does not give me the desired results.

For example
Download the image found here
http://bit.uni-koblenz.de/vibi/images/thumbs/t_lenna.jpg

I = imread('t_lenna.jpg');
figure,imshow(I); %displays me the image the same size as
% the original
figure,image(I);
axis equal; %does not show me the actual size of the image.
%Image does not resize the figure window

Vihang

Subject: image() and imshow()

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 19 Jan, 2008 16:54:58

Message: 4 of 8

In article <fmt96u$ce4$1@fred.mathworks.com>,
Vihang Patil <vihang_patil@yahoo.com> wrote:

>> axis equal

>This does not give me the desired results.

>figure,image(I);
>axis equal; %does not show me the actual size of the image.
>%Image does not resize the figure window

Ah, try axis image
--
   "I was very young in those days, but I was also rather dim."
   -- Christopher Priest

Subject: image() and imshow()

From: Vihang Patil

Date: 20 Jan, 2008 08:13:03

Message: 5 of 8

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <fmta12$d7k$1@canopus.cc.umanitoba.ca>...
> In article <fmt96u$ce4$1@fred.mathworks.com>,
> Vihang Patil <vihang_patil@yahoo.com> wrote:
>
> >> axis equal
>
> >This does not give me the desired results.
>
> >figure,image(I);
> >axis equal; %does not show me the actual size of the image.
> >%Image does not resize the figure window
>
> Ah, try axis image
> --
> "I was very young in those days, but I was also rather
dim."
> -- Christopher Priest

Nope that doesnt work either. I thing I am not able to
propogate my question properly.
Please try the following;

Download the image found here
http://bit.uni-koblenz.de/vibi/images/thumbs/t_lenna.jpg

I = imread('t_lenna.jpg');
figure,imshow(I); %displays me the image the same size as
% the original, as can be seen either in MSPAINT or Windows
% Picture and Fax Viewer
figure,image(I);
axis equal;
axis image; %none of these show me the way imshow shows the
%image
%Image does not resize the figure window

Vihang

Subject: image() and imshow()

From: Volkan

Date: 20 Jan, 2008 08:26:02

Message: 6 of 8

I = imread('t_lenna.jpg');
figure,imshow(I);
figure,image(I);
truesize;
axis off;

Subject: image() and imshow()

From: Vihang Patil

Date: 21 Jan, 2008 08:47:02

Message: 7 of 8

"Volkan " <volkan@buyukgungor.gmail.com> wrote in message
<fmv0iq$svn$1@fred.mathworks.com>...
> I = imread('t_lenna.jpg');
> figure,imshow(I);
> figure,image(I);
> truesize;
> axis off;

Dear Volkan

Yes, truesize is what I was looking for. Thank You.
Vihang

Subject: image() and imshow()

From: Lohitha

Date: 5 Feb, 2011 06:42:04

Message: 8 of 8

> Nope that doesnt work either. I thing I am not able to
> propogate my question properly.
> Please try the following;
>
> Download the image found here
> http://bit.uni-koblenz.de/vibi/images/thumbs/t_lenna.jpg
>
> I = imread('t_lenna.jpg');
> figure,imshow(I); %displays me the image the same size as
> % the original, as can be seen either in MSPAINT or Windows
> % Picture and Fax Viewer
> figure,image(I);
> axis equal;
> axis image; %none of these show me the way imshow shows the
> %image
> %Image does not resize the figure window
>
> Vihang
>
>

it worked for me. i only used axis image (didn't type axis equal before that)
but it only makes the dimensional ratios correct. the output image is smaller than the original one.
truesize gives the original sizes image.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us