[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Error in imadjust? and image package?
From: |
Laurent Hoeltgen |
Subject: |
Re: Error in imadjust? and image package? |
Date: |
Mon, 04 Jun 2012 12:08:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 |
On 06/04/2012 07:50 AM, address@hidden 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
> address@hidden
> 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 1x1 1 uint8
f 256x256 65536 uint8
g 256x256 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