problem with imadjust in octave

———- Forwarded message ———-
From: Laurent Hoeltgen <hoeltgman@gmail.com>
To: help-octave@octave.org
Cc:
Date: Mon, 04 Jun 2012 12:08:25 +0200
Subject: Re: Error in imadjust? and image package?
On 06/04/2012 07:50 AM, oka.kurniawan@gmail.com wrote:
> Hi I am trying to use some function in octave-forge package, particularly
> “image-1.0.15”. I can’t seem to get the result I expected. Can some help to
> advise?
>
> %%beginning of code%%
>
> This is my script:
> f=imread(‘einstein.tif’);
> imshow(f)
> g=imadjust(f,[0;1],[1;0]);
> imshow(g);
>
> %% end of code%%
>
> The link to the image is:
> http://scien.stanford.edu/images/labsite/einstein.tif
>
> I got all black result. I would expect the image to be inverted.
>
> I am using Ubuntu 12.04, and install Octave 3.6.1 with image-1.0.15.
>
> Thanks in advance.
>
> Regards,
> Oka
>
>
>
>
> ______________________________

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

Hi,

On my system, I get:

octave:10> whos
Variables in the current scope:

Attr Name            Size                     Bytes  Class
==== ====            ====                     =====  =====
ans             1×1                          1  uint8
f             256×256                    65536  uint8
g             256×256                    65536  uint8

in particular, f has integer values between 0 and 255 but you tell the
function that it has values between 0 and 1. The following should work:

g = imadjust(double(f)/255,[0,1],[1,0]);

Note that g is a double matrix then.

Regards,
Laurent

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: