Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: image() and imshow()

Subject: image() and imshow()

From: Vihang Patil

Date: 19 Jan, 2008 15:13:03

Message: 1 of 7

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 7

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 7


> 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 7

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 7

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 7

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 7

"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

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
truesize Volkan 20 Jan, 2008 03:26:25
axis Vihang Patil 19 Jan, 2008 10:16:06
imshow Vihang Patil 19 Jan, 2008 10:16:06
image Vihang Patil 19 Jan, 2008 10:16:06
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics