How to connect opencv in Python to Java Swing

Question from ☮𝙬𝙖𝙟𝙚𝙚𝙝𝙖☮#5024

hey people. so, i did my backend of the project in opencv-python and developed the front end using swing java. now i want to connect them. can somebody guide me how to do this?

This is, conceptually, what an API is for.

Not necessarily an "api served over http" but just the general thrust of "these are two independent processes that will communicate via some mechanism".

More details about how you want these things to communicate would be helpful - are they going to be run on the same machine, etc.

Yes I want them to run on the same machine

I searched a little bit and found some method

Using execute shell command

But I'm not receiving the output I want

Maybe I'm doing something wrong idk

From the Java side you can launch the python app using ProcessBuilder and then. communicate that way.

https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ProcessBuilder.html

Ok I will try this thanks for the link.

That's just step 1, but yeah start there.


<- Index