following the wiki article on how to use openFrameworks with the C++ TOP in TouchDesigner088 32-Bit version, I was able to implement this fairly simple example of facetracking with openCV from the book Programming Interactivity.
Unfortunately I picked a rather slow example as the texture which is passed into the c++ TOP needs to be copied back from the GPU to the CPU which is in general not very fast, but this might be a good example showing the fairly simple integration of the libraries available in openFrameworks.
FaceTrackingOpenFrameworks.zip (5.55 MB)
The file FaceTrackingOpenFrameworks.zip contains a toe file and all necessary dlls and the haarcascade definition required to detect faces. On load make sure to reinitalize the C++ TOP.
ofopenCVTest.zip (26.4 MB)
The file ofopenCVTest.zip contains the full source of the project. Unzip and place the folder into the apps/myApps folder of your openFrameworks release.
For this experiment I used openFrameworks ver. 0.8.0 and compiled with Visual Studio Express 2012.
Remember that as the version of openFrameworks only compiles for 32-Bit, the project will only work in the 32-Bit version of TouchDesigner088.
Hope this helps a little on getting going with utilizing what openFrameworks has to offer.
So now, anyone started working on a x64 build of openFrameworks on windows ?
From a quick search, it looks like quicktime dependencies need to be removed since quicktime is 32bits only (used for video playback in OFX so shouldn’t be needed within touch anyway), and then it’s a matter of building/using x64 versions of the other libs used by openFrameworks , which is a bit tedious…
Maybe an easier option would be to start with a lighter x64 version of OFX, removing more dependencies…
I’ll get into this but if some do it first I’m all ears
It would be nice if, when directly connecting a moviein TOP to a c++ TOP, that we could reference the incoming data from CPU memory instead of a texture. Maybe also when sequencing multiple c++ TOPs …
The event methods can’t be used because we are stripping away the conflicting “application” part of openFrameworks to gain access to the graphics API. You could use a Mouse In CHOP and Keyboard In CHOP/DAT to pass the required data into the execute method of your TOP, from which you can figure out what events have happened since the last frame.