Image functions no longer return images

View: New views
8 Messages — Rating Filter:   Alert me  

Image functions no longer return images

by J Heeris :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Using octave 3.0.0 with package "image" 1.0.4, on Debian GNU/Linux (Lenny, 2.6.23 custom kernel).

I notice that functions such as imshow and image no longer return image matrices, but just floating point values. Even using __go_image__ won't return matrices:

octave:2> tmp = __go_image__ (gca(), "cdata", eye(100), "xdata", [1,100], "ydata", [1,100])

tmp = -2.3099

This still displays an image using gnuplot.

Is this a bug, or has there been a change to the API?

Re: Image functions no longer return images

by Søren Hauberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


ons, 30 01 2008 kl. 04:32 -0800, skrev J Heeris:
> Using octave 3.0.0 with package "image" 1.0.4, on Debian GNU/Linux (Lenny,
> 2.6.23 custom kernel).
>
> I notice that functions such as imshow and image no longer return image
> matrices, but just floating point values.
I'm confused. Have 'imshow' ever returned an image? I mean, why would
it?

Søren

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: Image functions no longer return images

by Michael Goffioul-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 1/30/08, J Heeris <jason.heeris@...> wrote:

>
> Using octave 3.0.0 with package "image" 1.0.4, on Debian GNU/Linux (Lenny,
> 2.6.23 custom kernel).
>
> I notice that functions such as imshow and image no longer return image
> matrices, but just floating point values. Even using __go_image__ won't
> return matrices:
>
> octave:2> tmp = __go_image__ (gca(), "cdata", eye(100), "xdata", [1,100],
> "ydata", [1,100])
>
> tmp = -2.3099
>
> This still displays an image using gnuplot.
>
> Is this a bug, or has there been a change to the API?

As Matlab does, those functions now return a handle to
an image object. This handle is represented by a
scalar (semi-random) number.

Michael.
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: Image functions no longer return images

by J Heeris :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Søren Hauberg wrote:
ons, 30 01 2008 kl. 04:32 -0800, skrev J Heeris:
> Using octave 3.0.0 with package "image" 1.0.4, on Debian GNU/Linux (Lenny,
> 2.6.23 custom kernel).
>
> I notice that functions such as imshow and image no longer return image
> matrices, but just floating point values.
I'm confused. Have 'imshow' ever returned an image? I mean, why would
it?

Søren

_______________________________________________
Help-octave mailing list
Help-octave@octave.org
https://www.cae.wisc.edu/mailman/listinfo/help-octave
Sorry, I meant "imagesc".

If these functions return image handles, how do I use them with, say, "imwrite"? The documentation for "imwrite" doesn't seem to have changed to detail this. Now I just get "error: expecting integer index, found -6.139061" when trying to use the results of "imagesc" with "imwrite".

Re: Image functions no longer return images

by James Sherman Jr.-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jan 30, 2008 6:28 PM, J Heeris <jason.heeris@...> wrote:

>
>
>
>
> Søren Hauberg wrote:
> >
> >
> > ons, 30 01 2008 kl. 04:32 -0800, skrev J Heeris:
> >> Using octave 3.0.0 with package "image" 1.0.4, on Debian GNU/Linux
> >> (Lenny,
> >> 2.6.23 custom kernel).
> >>
> >> I notice that functions such as imshow and image no longer return image
> >> matrices, but just floating point values.
> > I'm confused. Have 'imshow' ever returned an image? I mean, why would
> > it?
> >
> > Søren
> >
> > _______________________________________________
> > Help-octave mailing list
> > Help-octave@...
> > https://www.cae.wisc.edu/mailman/listinfo/help-octave
> >
> >
>
> Sorry, I meant "imagesc".
>
> If these functions return image handles, how do I use them with, say,
> "imwrite"? The documentation for "imwrite" doesn't seem to have changed to
> detail this. Now I just get "error: expecting integer index, found
> -6.139061" when trying to use the results of "imagesc" with "imwrite".

I don't have octave available currently, but I believe the function
you're looking for is either save or saveas (can't remember which one
it is).

James

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: Image functions no longer return images

by J Heeris :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I don't think it is: "save " only saves the raw data, not images as (say) PNG, and I can't find a documentation entry for "saveas".

James Sherman Jr.-2 wrote:
On Jan 30, 2008 6:28 PM, J Heeris <jason.heeris@gmail.com> wrote:
>
>
>
>
> Søren Hauberg wrote:
> >
> >
> > ons, 30 01 2008 kl. 04:32 -0800, skrev J Heeris:
> >> Using octave 3.0.0 with package "image" 1.0.4, on Debian GNU/Linux
> >> (Lenny,
> >> 2.6.23 custom kernel).
> >>
> >> I notice that functions such as imshow and image no longer return image
> >> matrices, but just floating point values.
> > I'm confused. Have 'imshow' ever returned an image? I mean, why would
> > it?
> >
> > Søren
> >
> > _______________________________________________
> > Help-octave mailing list
> > Help-octave@octave.org
> > https://www.cae.wisc.edu/mailman/listinfo/help-octave
> >
> >
>
> Sorry, I meant "imagesc".
>
> If these functions return image handles, how do I use them with, say,
> "imwrite"? The documentation for "imwrite" doesn't seem to have changed to
> detail this. Now I just get "error: expecting integer index, found
> -6.139061" when trying to use the results of "imagesc" with "imwrite".

I don't have octave available currently, but I believe the function
you're looking for is either save or saveas (can't remember which one
it is).

James

_______________________________________________
Help-octave mailing list
Help-octave@octave.org
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: Image functions no longer return images

by Michael Goffioul-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jan 31, 2008 at 12:28 AM, J Heeris <jason.heeris@...> wrote:
> Sorry, I meant "imagesc".
>
> If these functions return image handles, how do I use them with, say,
> "imwrite"? The documentation for "imwrite" doesn't seem to have changed to
> detail this. Now I just get "error: expecting integer index, found
> -6.139061" when trying to use the results of "imagesc" with "imwrite".

I have the impression you're mixing different stuffs. "imagesc" is for
displaying
an image, "imwrite" is for saving an image into a specified format.
Both functions
take the same kind of input: an image (usually represented by a matrix). The
handle returned by imagesc is for manipulating the *displayed* image
(by using "set(handle, ...)"). If you want to retrieve the image data from a
handle (provided the handle points to an image graphics object), you can
still use "get(handle,...)".

Michael.
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: Image functions no longer return images

by J Heeris :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well, basically my question is: It used to be possible to do this...

im1 = imagesc(flipud(20*log10(S)));
M = jet(64);
imwrite(imfilename,im1,M);

...because "imagesc" would return the scaled image data. Now it doesn't. Simply put, these functions used to work this way, and now they don't, so how do I use them? The documentation for "imwrite" and "imagesc" is still the same, and they don't seem to have changed internally.

Using "imwrite" on manually scaled data itself doesn't work either, by the way. Maybe the problem is with "imwrite" (or the way I'm using that) and not the other functions:

octave:3> imwrite("png:test", eye(100), M);
warning: warn_empty_list_elements is no longer a built-in variable; please read the NEWS file or type `news' for details
warning: warn_empty_list_elements is no longer a built-in variable; please read the NEWS file or type `news' for details
error: invalid row index = 0
error: evaluating argument list element number 1
error: evaluating assignment expression near line 278, column 8
error: evaluating if command near line 272, column 1
error: called from `imwrite' in file `/usr/share/octave/packages/image-1.0.4/imwrite.m'


Michael Goffioul-2 wrote:
On Thu, Jan 31, 2008 at 12:28 AM, J Heeris <jason.heeris@gmail.com> wrote:
> Sorry, I meant "imagesc".
>
> If these functions return image handles, how do I use them with, say,
> "imwrite"? The documentation for "imwrite" doesn't seem to have changed to
> detail this. Now I just get "error: expecting integer index, found
> -6.139061" when trying to use the results of "imagesc" with "imwrite".

I have the impression you're mixing different stuffs. "imagesc" is for
displaying
an image, "imwrite" is for saving an image into a specified format.
Both functions
take the same kind of input: an image (usually represented by a matrix). The
handle returned by imagesc is for manipulating the *displayed* image
(by using "set(handle, ...)"). If you want to retrieve the image data from a
handle (provided the handle points to an image graphics object), you can
still use "get(handle,...)".

Michael.
_______________________________________________
Help-octave mailing list
Help-octave@octave.org
https://www.cae.wisc.edu/mailman/listinfo/help-octave