hello
this might be a stupid question that fundamentally misunderstands how touch and python can interact - i use a lot python scripting for stuff rather than patching but had a question around using a library like openCV and whether we can use a TOP as the camera or input to some image detection so that i can do cropping thresholding etc and pass the resulting TOP into a script DAT…
While you can do that, I don’t know that I’d recommend doing that - python is pretty slow in the context of touch, so your performance will suffer the larger your sampling texture is. You could instead use a GLSL TOP - and write a shader instead, though if you’re using a specific library that might be a little cumbersome.
I don’t know if this would work or not, but you might be able to write your dll as a pyd - I don’t know enough here to offer any guidance, but that seems possible from a theoretical perspective.
great - thanks
felt like it would be nice to able to put a bit of python downstream to do some CV stuff in a quick sketchy way like dropping OPs - but i take the point on performance -
ended up ‘outsourcing’ the CV stuff to VVVV and got it chatting back and forth with Touch via OSC
Currently in 099 it’s possible to read image files in opencv with python, see example on 099 OpenCV wiki page
There is no option yet to read/write TOP->OpenCv or OpenCV->TOP, but I can imagine it’s something Derivative has on its nice-to-have wishlist.