Hi Ross,
I've come across this before too. If you follow the trail of
functions that 'imshow' actually uses, you'd see that after it creates
a colormap and an indexed image from the r/g/b parameters, it uses the
'image' command to display them. 'image' takes a scale parameter, but
in this case, imshow doesn't pass one, in the case of no scale
parameter, 'image' decides to make a scaled image, hence, your
320x240. You got a couple of choices, you could create you're own
version of 'imshow' and add a scale parameter, something like this
imshow (a1, a2, a3, scale)
....
....
image (a1, scale)
....
....
or at the very least
....
image (a1, 1)
....
This problem bothers me often too, but I'm not sure what the
mainstream solution would be since changing the definition for
'imshow', as distributed with octave, would break from compatibility
with other numerical programs which shall remain un-named.
Maintainers have any thoughts?
JD
Ross Vandegrift wrote:
Hello everyone,
I'm working on an image analysis project, and am using imread to
read in a color 640x480 JPEG file and sample some points.
Oddly though, when read in and displayed, the graphic is
displayed as 320x240. If I manually run "display eye.jpg", the image is
loaded as 640x480. I've tried setting "-size 640x480" and "-sample
640x480" in the options, neither one helps.
Here's how I'm loading/displaying my image:
[red, green, blue] = imread('jpg:eye.jpg', ["-size 640x480";]);
red = red / 255;
blue = blue / 255;
green = green / 255;
imshow(red, green, blue)
It's not a critical problem or anything - I'm still able to work
on the project at 320x240, but is there something I can do to get
640x480?
Thanks!