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: Carnë Draug
Subject: Re: using JavaOctave for image processing
Date: Sun, 12 Aug 2012 18:09:29 +0100

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]