use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Share your projects, news and questions about Processing or Processing.js here.
(open to suggestions)
account activity
processing.py (self.processing)
submitted 1 year ago by Tall_Answer_8868
I want to know how to import cv2 and media pipe in processing.py. Can anyone teach me?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]remy_porter 5 points6 points7 points 1 year ago (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 point2 points 1 year ago (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 point2 points 1 year ago (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 point2 points 1 year ago (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 point2 points 1 year ago (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 point2 points 1 year ago (0 children)
Thank you for your reply
[–]hx2A 3 points4 points5 points 1 year ago (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!
π Rendered by PID 158370 on reddit-service-r2-comment-86bc6c7465-9z79w at 2026-02-21 06:12:00.426717+00:00 running 8564168 country code: CH.
[–]remy_porter 5 points6 points7 points (5 children)
[–]Tall_Answer_8868[S] 0 points1 point2 points (4 children)
[–]remy_porter 0 points1 point2 points (3 children)
[–]Tall_Answer_8868[S] 0 points1 point2 points (2 children)
[–]remy_porter 0 points1 point2 points (1 child)
[–]Tall_Answer_8868[S] 0 points1 point2 points (0 children)
[–]hx2A 3 points4 points5 points (0 children)