The first technical step of this project is to control an output signal from a video input.
The first part of the patch is the camera connection. By using a "getvdevlist" and "getinputlist" objects, I can easily select the proper video feed. You can easily build this patch and understand it better with this tutorial.
Now that I have an input, I needed to generate informations out of it in order to trigger the signal at the end of the patch. To do so, I based my patch with this frame-differences tutorial. In this patch, the "jit.op" object calculates the difference in pixels between the image and its previous one and the "jit.rgb2luma" object transfer it as a luma channel. That way, everything that is still in the image become black and the difference between images (so what is in motion) becomes visible in white.
The "jit.3m" object then gives us a single value of the average of this difference. It is with this value that I will trigger the output and thus control the vibration/motion that will be send to the Bioluminescent algae. To trigger the output, I just give a number (that can be adjusted with a slider) that become the threshold. This video explains well the process of this part of the patch.
Finally, every time the "jit.3m" value goes over the threshold value, the trigger is turned on and when the value goes under the threshold number, the trigger turned off. Usually, the output signal would be a vibration on the phytoplankton, but for my tests, I simply used a LED light on Arduino and the Dimmer patch we used earlier in the class. So every time the trigger turned on, it sent a "255" message to the light, which turned it on fully, and when the trigger turned off, a "0" message was sent in order to close the light.
Here is an image of the full patch as well as a video to demonstrate the relationships in it. In the video, to make it easier to see, I simply used a trigger object instead of the connection with Arduino.
- Full patch: File:Camera_Control.maxpat