Those of you who run OpenCV written in C++, do you think the speed improvements are worth using Python in OpenCV. I know python’s bindings are in OpenCV…
But code like sending over sockets, processing arrays and such should be slower in python.
Only reason I am hesitant about C++ is settuing up a corss compiler/debugging it is a pain
We point to it from the Raspberry Pi FRCVision image C++ example’s README, but here’s a direct link to the Raspbian cross-compiler we build. I highly recommend you take a look at FRCVision if you haven’t yet.
Probably doesn’t make much difference, particularly if you use numpy instead of doing all the loops in pure Python, as then basically all the heavy lifting is in C++ anyway. The Raspberry Pi 3 and 4 especially are pretty fast.
How much data are you sending? In Python the under-the-hood stuff is still C++, except for the current version of pynetworktables, which currently is written in Python (but they’re looking at switching it to use the C++ library as well).
The image processing code is essentially the same speed in Python and C/C++ (as long as you are a little bit careful). That is because all the major processing should be done by the OpenCV code, which is all in C++.
The networking code in Python is also mostly in C, I believe. Irrespective, sending 50 bytes everyone 10s of milliseconds will not tax Python code and you would be hard pressed to see the difference.