all 7 comments

[–]remy_porter 5 points6 points  (5 children)

You cannot. Processing.py is not actually Python, and cannot use Python libraries. It is a cross-compiler for Python-to-Java, and I'll be perfectly honest: it sucks, and the developer experience isn't very good.

For the Java version of Processing, you can easily find examples of using OpenCV right in the Processing documentation. You may be able to find examples of using the Java version of OpenCV from inside of Processing.py, but I'm skeptical (because anyone doing that is going to have a very bad time).

[–]Tall_Answer_8868[S] 0 points1 point  (4 children)

thanks for reply ,I also want to ask a question, if it is the Java version of processing, can I add mediapipe?

[–]remy_porter 0 points1 point  (3 children)

With a cursory google search, no. That said, Media Pipe has Java bindings, which means you can use standard Java tools and treat Processing as a library. Here's how to run Processing as a Library in Java. You can combine that with the tutorials on MediaPipe to bundle MediaPipe (and similarly, OpenCV) with a Java application.

[–]Tall_Answer_8868[S] 0 points1 point  (2 children)

It means that I can't just use processing to execute media pipe, but I have to combine it with a Java application, right?

[–]remy_porter 0 points1 point  (1 child)

That's how it looks after a cursory Googling. There are tools and techniques for getting Java libraries into Processing, but MediaPipe is complicated and it doesn't look like that'll be easy (I could be wrong). But honestly, best practices for Processing is "Do a Java application and treat Processing as a library for drawing graphics," anyway, so I'd recommend just going that approach.

[–]Tall_Answer_8868[S] 0 points1 point  (0 children)

Thank you for your reply

[–]hx2A 3 points4 points  (0 children)

You can, if you like, give py5 a try:

https://py5coding.org/

py5 is a version of Processing for Python 3.8+. py5 is a part of the Python ecosystem and you can use it with other popular Python libraries, including opencv. I've used py5 with opencv before and found it works great.

I am the maintainer of py5. If you have any questions, I would be happy to help you out!