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: Martin Helm
Subject: Re: using JavaOctave for image processing
Date: Sun, 12 Aug 2012 18:40:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0

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.
>
> 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




reply via email to

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