help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: image from matrix at original size [newbie]


From: Ben Abbott
Subject: Re: image from matrix at original size [newbie]
Date: Mon, 26 Dec 2011 10:10:19 -0500

On Dec 26, 2011, at 6:43 AM, marasolc wrote:

> Hi all!
> 
> Here is my problem:
> I've got a data matrix from a camera saved as .txt file, it is 256x1024
> matrix. I load the matrix into /img/ variable. Then I want to show the color
> image (with /limits/) at its original size 1024x256, attach colorbar and
> save forexample as png - something like this:
> 
> img = load("data.txt");
> map = jet(64);
> colormap(map);
> imagesc(img, [minv maxv]);
> colorbar();
> print("image.png","-dpng");
> 
> Nevertheless, all the time the resulting image is somehow resized, which
> happens also with imshow function. The saved png image is somehow resized
> too. I can improve it using stuff like set(gca,"position"...) and
> print("image.png","-dpng","-S1024,256"), but only if I omit the colorbar.
> 
> Could you please give me some hints for a neat solution of this problem?
> Thank you a lot,
> Marek  

You're trying to display the image with the same number of pixels ?

You can do that by adjusting the figure and axes position properties.

The figure's position property has units of pixels and the axes position 
property is normalized to the figure.

The print command isn't designed to preserve the image in pixels either. For 
that take a look at the image commands (imread, imwrite).

        help imread
        help imwrite

I'm not sure how familiar you are with Octave, so please follow up with more 
questions if needed.

Ben



reply via email to

[Prev in Thread] Current Thread [Next in Thread]