help-octave
[Top][All Lists]
Advanced

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

Re: Image aspect ratio


From: Divakar Ramachandran
Subject: Re: Image aspect ratio
Date: Sun, 14 Aug 2011 14:10:36 +0530
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11

On Saturday 13 August 2011 08:23 PM, Ben Abbott wrote:
On Aug 13, 2011, at 9:00 AM, Divakar Ramachandran wrote:

I am using Octave 3.2.4 on Microsoft Windows 7.

A = imread("A8.tif");

followed by

imshow(A) or imagesc(A)

results in a Gnuplot window that displays the image stretched along x-axis. axis("square") or axis("image") improves the aspect ratio slightly, but not to 1:1 that I require.

Is there any workaround for this?

Thanks in advance,
Divakar
My initial thought is that your image isn't square. What is its size ?

	size (A)

The image is square, 1024 x 1024 pixels:

octave-3.2.4.exe:388>INFO = imfinfo("A8_1.tif")
INFO =
{
  Filename = C:\Users\divakar\Documents\A8_1.tif
  FileSize =  1048784
  Height =  1024
  Width =  1024
  BitDepth =  8


Another possibility is that your display has a different number of pixels per inch in the horizontal and vertical directions? (this is rather rare).

If you type the commands below ...

	imshow (A)
	axis on

... and then measure the physical size of the axes box, what does the following return?

	dpi = [diff(get(gca,"xlim")), diff(get(gca,"ylim"))] ./ [axis_box_width, axis_box_height]

... where axis_box_width and axis_box_height are the physical sizes of the plot.


This seems true in my case on the Dell Inspiron 580 desktop running Win 7 Pro 64-bit:

octave-3.2.4.exe:386>imshow(A)
octave-3.2.4.exe:377>axis("square")
octave-3.2.4.exe:381>dpi = [diff(get(gca,"xlim")), diff(get(gca,"ylim"))] ./ [18, 11.2]
dpi =

   56.833   91.339

octave-3.2.4.exe:379>

Is there a workaround for this? Maybe a display property I can set somewhere and invoke through startup.m? I have also tried drawing circles using SmallBasic - these look fine. Somehow, the display geometry is not being sensed in Octave.

Ben
I do not have this problem on Octave 3.2.3 installed on my laptop running Ubuntu 10.04 LTS 64-bit.

Thanks, Ben, for the help,
Divakar

--
Divakar Ramachandran Anupuram, TN 603127, INDIA

reply via email to

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