help-octave
[Top][All Lists]
Advanced

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

Re: using JavaOctave for image processing


From: kermitts \(sis\)
Subject: Re: using JavaOctave for image processing
Date: Sun, 12 Aug 2012 22:02:38 +0000

Thank you very much for the attentions.
My very basic question is when I try to implement the code on kenai project is 
if I do defines it as OctaveDouble do the java recognise it as an image? 
I do save the results as an variable.. :)  
So the java will be able to read it as an image by using a variable type 
im-arr.. Am I right? :D *just re-checking because sometime I do misunderstand 
things :)*

May I post a piece of my code just to know wether I am doing it right or wrong? 


>>
Since your code is written in Java, have you considered using
ImageJ[1] instead? I'd recommend to install it through FIJI [2] if you
are interested. I find it really fast and it's on the public domain.

Yes I already know the imageJ, is it faster to use that rather than octave? I 
would like to use it but since all the calculation I had is already written in 
octave, I try this thing first :) 
If you say so... I will try it sooon :) 

Thank you

Sent from my BlackBerry®
powered by Sinyal Kuat INDOSAT

-----Original Message-----
From: Carnë Draug <address@hidden>
Sender: address@hidden
Date: Sun, 12 Aug 2012 18:09:29 
To: <address@hidden>
Cc: Martin Helm<address@hidden>; address@hidden<address@hidden>
Subject: Re: using JavaOctave for image processing

On 12 August 2012 17:40, Martin Helm <address@hidden> wrote:
> Am 12.08.2012 18:07, schrieb kermitts (sis):
>> I would like to do some preprocessing of a large scale  images.
>> The project objective was to speed up the time consume. To achieve this I am 
>> using hadoop mapreduce. I am using octave to handle the image preprocessing.
>> Since written the code in java, I use java-octave as its bridge.

Since your code is written in Java, have you considered using
ImageJ[1] instead? I'd recommend to install it through FIJI [2] if you
are interested. I find it really fast and it's on the public domain.

[1] http://imagej.nih.gov/ij/
[2] http://fiji.sc/wiki/index.php/Fiji

>> I got confused when I have to pass the results of the preprocessed image to 
>> what type of variable.. Before I can use it in java.. (I saw the java-octave 
>> example on project kenai)
>> Is it matrix or what.. :)
>> Maybe I'll define it as a matrice first.. I'll try it,whether the java can 
>> recognize the type or not..
>> I'll keep you updated to the trial results.. :)
>>
> Thanks, please keep the list on CC, others may be interested as well to
> make such things fly.
> The by far easiest way is of course to turn whatever image class you use
> in java that one for example into a double[] im_arr and then pass it
> with the OctaveDouble constructor to octave.
>
> new OctaveDouble(im_arr, image_row_number, image_col_number)
> or
> new OctaveDouble(im_arr, image_row_number, image_col_number, 3)
> for a rgb image (of course the order of entries in your im_arr needs to
> properly match)
>
> (similar if you do not want to use double but some other supported type).
> The other way around is then to fetch the result (I assume here you
> assigned it to a variable result in octave, I use the variable octave
> here as the name of the octave script engine instance)
>
> result = octave.get(OctaveDouble.class, "result")
>
> //to get the raw double[] data you just call
> result_raw_data = result.getData()
> //and to get the dimensions as array of integers
> result_dimensions = result.getSize()
>
> if double is to memory consuming choose some other type as long as it is
> supported by the functions i octave

Most functions of the image package should support images of all
types. If you convert your images to double though, values will be
expected to be on the range [0, 1].

Carnë

reply via email to

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