4

I have a Java GUI that takes video frames into a byte array, and saves them directly to a raw output file. I am able to then load this file into MATLAB and execute my signal processing algorithm. However, the raw file ends up being about 1GB and takes a very long time to open in MATLAB.

Currently I use a Process, inside a SwingWorker to run an instance of MATLAB and have the algorithm execute and generate the results. This is all working correctly, but the loading the 1GB raw file into MATLAB is very slow, on the order of 30 seconds.

I am wondering if there is anyway to directly pass the Java byte array to MATLAB?

Thanks in advance!

1 Answer 1

2

Matlab runs its own Java Virtual Machine, so you can call Java classes from within it and receive java objects returned from invoking methods on java classes. In this case your byte array would be translated directly into a uint8 array.

Depending on JVM and interaction constraints with the Java program, this may be the easiest way to transfer the data.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.