We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi there, I would like to know if there is way to run a matlab code from within Processing...
The code I am interested in using is: http://ceng.anadolu.edu.tr/cv/EDPF/
Which is C++ as far as I am aware.
I've heard of a thing called "javabuilder" for matlab, but im not sure how I could use it in this situation.
Can it be done?
Cheers
Answers
Do you have MATLAB separately installed on your system, and are your trying to invoke a MATLAB script from within your sketch, e.g. with
exec()
?MATLAB is proprietary, licensed software -- I don't believe that you can run it without MATLAB in any other environment, by design.
@jeremydouglass, hey thanks for the response....I ended up getting the c++ source code for this...though it still isnt going to help since there is no c++ mode in Processing.
Ill ask in a different question, but here as well since its still a line segment detection code, how can I import https://github.com/anfractuosity/LSD
into Processing? Where would I start?
If you want to do Processing-like coding in C++, here is always openFrameworks:
If you are using a Java library instead, you can put it in a /code subfolder of your sketch -- or drag-and-drop onto the PDE window to import.
Cool yeah, I've been using Openframeworks as well, still prefer Processing though.
Great, I should have figured that one out on my own lol, too easy.
I think its working, though im not getting anything other than a grey box...is there something Im missing here?
Its supposed to use the piet image.
We can mix ".pde" & ".java" files in the same folder together w/ the PDE (Processing's IDE).
There is no way for us to know what might be wrong unless you share an MCVE.
I literally just dragged and dropped all the java files from the github into a sketch in Processing: https://github.com/anfractuosity/LSD
Basically what the code is supposed to do is to extract line segments from an image, so like a much simplified contour.
The result look like this: http://iie.fing.edu.uy/~jirafa/lsd/technical-report-fig14.html
I contacted the author, and he has told me for this he was using the "swing GUI kit" and that I would need to change it to use Processing's GUI calls.
...im assuming thats refering to the GUI.java ?
So this library isn't compatible w/ Processing, b/c direct access to Swing conflicts w/ Processing's own Swing access.
The library needs to be re-written so it calls Processing's API rather than Java's Swing direct access.
@GoToLoop
Aw man, I figured.
Ok...so I would be changing the GUI.java right?
How can I call Processing's API instead of swing ?
public class GUI extends JFrame {
Processing's JAVA2D renderer already got its own instance of JFrame.
Look for past getFrame() posts: https://Forum.Processing.org/two/discussions/tagged?Tag=getframe()
Also you need to learn Processing's API in order to replace those Swing direct calls:
https://Processing.org/reference/
Cool thanks, ill see what I can do.
I did find something you did a bit back: https://forum.processing.org/two/discussion/12774/embedding-papplet-in-java-jframe
Im a bit lost. Can you tell me what exactly does this getJframe() do? Currently im trying to do PApplet...