DSPRelated.com
Forums

plotting matrix to image

Started by S.KAMALESH VIVEK April 27, 2005

hi friends,
I need to plot a matrix data (2-Dimensional-MxN) stored in a variable (say a) to an image. i just used, size of a is 751x550 figure,imshow(a).

But the image i got was scalled automatically to 56% as the system was unable to show the full size. Due to this the image gets compressed along the longitudinal axis.This prevents me in analysingsome information in the image.
what i think is the aspectratio of the image is not locked.

If there is anyway to show the image at 100% or get a scaled image with locked aspect ratio.

the second thing is i need to know how to store the image displayed by image or images function to a variable

please help me
thanks in advance
bye
s.kamalesh vivek FRIENDSHIP NEVER FAILS
S.KAMALESH VIVEK



hi KAMALESH,

solution 2 ur second problem is:

I = imread('picture.png');

this image "picture.png' should be in work directory. You can specify any file format allowed in matlab. plz tell me if this helps you.

regards

humera

h r
 
i.p.emsmile.gif
 
 
 
>From: "S.KAMALESH VIVEK" <c...@yahoo.co.in> >To: mat lab <m...@yahoogroups.com> >Subject: [matlab] plotting matrix to image >Date: Wed, 27 Apr 2005 04:58:19 +0100 (BST) > > >hi friends, > I need to plot a matrix data (2-Dimensional-MxN) stored in a variable (say a) to an image. i just used, size of a is 751x550 > > >figure,imshow(a). > >But the image i got was scalled automatically to 56% as the system was unable to show the full size. Due to this the image gets compressed along the longitudinal axis.This prevents me in analysingsome information in the image. >what i think is the aspectratio of the image is not locked. > >If there is anyway to show the image at 100% or get a scaled image with locked aspect ratio. > >the second thing is i need to know how to store the image displayed by image or images function to a variable > >please help me >thanks in advance >bye >s.kamalesh vivek > > >FRIENDSHIP NEVER FAILS > S.KAMALESH VIVEK > > >


Hi,
The following works for me:
h=figure('position',[10 10 851 650]);
hx=axes('units','pixels','position',[50 50 751
550]);
imshow(a,[],'InitialMagnification',100)

Note: For older versions use 'truesize'

Joe Sababa

The new BSTeX - Equation viewer for Matlab7
http://www.geocities.com/bstex2001/

--- "S.KAMALESH VIVEK" <contact_skavivek@cont...>
wrote:
>
> hi friends,
> I need to plot a matrix data
> (2-Dimensional-MxN) stored in a variable (say a) to
> an image. i just used, size of a is 751x550 > figure,imshow(a).
>
> But the image i got was scalled automatically to 56%
> as the system was unable to show the full size. Due
> to this the image gets compressed along the
> longitudinal axis.This prevents me in analysingsome
> information in the image.
> what i think is the aspectratio of the image is not
> locked.
>
> If there is anyway to show the image at 100% or get
> a scaled image with locked aspect ratio.
>
> the second thing is i need to know how to store the
> image displayed by image or images function to a
> variable
>
> please help me
> thanks in advance
> bye
> s.kamalesh vivek > FRIENDSHIP NEVER FAILS
> S.KAMALESH VIVEK >
>

__________________________________________________




Namaste Mr. S.KAMALESH VIVEK
 
if you receive
 
    Warning: Image is too big to fit on screen; displaying at nn% scale.
   
the problem is that "imshow" is only for intensity vector in pictures, you can use instead "image" for matrix to image translation.
For better results you can normalize the matrix to 128 or 256 levels.
 
>>A= a*127/max(max(a))
>>image(A)
>>colormap(gray(128))
>>save ImageMatrixName.mat A % ??? 2nd question that I dont understand, you have this variable... 
 
 
Best Regards
 
Henry
 
Message: 3        
   Date: Wed, 27 Apr 2005 04:58:19 +0100 (BST)
   From: "S.KAMALESH VIVEK" <c...@yahoo.co.in>
Subject: plotting matrix to imagehi friends,
            I need to plot a matrix data (2-Dimensional-MxN) stored in a variable (say a) to an image. i just used, size of a is 751x550
 
 
figure,imshow(a).
 
But the image i got was scalled automatically to 56% as the system was unable to show the full size. Due to this the image gets compressed along the longitudinal axis.This prevents me in analysingsome information in the image.
what i think is the aspectratio of the image is not locked.
 
If there is anyway to show the image at 100% or get a scaled image with locked aspect ratio.
 
the second thing is i need to know how to store the image displayed by image or images function to a variable
 
please help me
thanks in advance
bye
s.kamalesh vivekFRIENDSHIP NEVER FAILS
   S.KAMALESH VIVEK