The Java binding of OpenCV has a number of data classes in the form of MatOfxxx, where xxx is other datatype such as Int, Float, Point. This example will demonstrate the use of MatOfInt class. These classes will usually be used for parameters passing between different OpenCV functions. We can manipulate it similar to array and List.
Continue reading
OpenCV and Processing 3
This example will demonstrate the use of CvType, Size and Scalar.
CvType defines all the matrix types in OpenCV. It describes the number of channels, and depth information for each element (pixel) in the matrix. This example will use CV_8UC1 – 8 bits unsigned char, 1 channel. To communicate with Processing, we usually take CV_8UC4 for ARGB as the RGB format in PImage also uses 4 bytes for storage.
Continue reading
Kinect for Processing Library – Kinect4WinSDK Listed
The new Kinect for Windows SDK library is now officially listed under the Libraries section of the Processing website. Please try and test. Feedback welcome.
Kinect for Processing Renamed
The Kinect for Windows SDK library for Processing is renamed again to cater for the naming convention in the Processing standard. It is now called Kinect4WinSDK. The main class is Kinect, instead of P5Kinect or PKinect.
The new library is built in Windows 7, with Java JRE 1.7u60, Kinect for Windows SDK 1.8, and tested in Processing 2.2.1.
Some thoughts about the recent OpenCV and films works
It is about time to write up something about the recent works (post 1, post 2) that I have done with OpenCV and the classic film sequences. I started the recent version of the project first for the submission to the Image Conference in Berlin and then the Microworld exhibition in Hong Kong. The software I have been testing is the OpenCV library, openFrameworks and Processing. For the final show, I may choose openFrameworks for performance and stability reasons.
Drawing Machines
In the recent preparation for classes, I come into this topic of drawing machines. Here are some examples from YouTube.
And the Machine Art exhibition
Art Machines Machine Art
Kinect for Processing Library Page
The Kinect for Processing library page is now ready with documentation, example, download and source codes. Happy coding.
Neurosky MindWave and Processing
This is my first trial run of a Neurosky MindWave sensor with a custom program written in Processing. The connection architecture is quite straight forward. The ThinkGear connector is a background process that reads from the IR serial port to obtain the brainwave signals and distributes them through a TCP socket server (localhost with port 13854).
There are a number of Java socket clients implementation. I use the ThinkGear Java library from Creation.
Eric Blue has another Processing based visualizer using the MindWave.
ZeroShore has another implementation with an animation called HyperCat.
Sample Code
import processing.video.*; import neurosky.*; import org.json.*; ThinkGearSocket neuroSocket; int attention = 0; int meditation = 0; int blinkSt = 0; PFont font; int blink = 0; Capture cap; void setup() { size(640, 480); ThinkGearSocket neuroSocket = new ThinkGearSocket(this); try { neuroSocket.start(); } catch (ConnectException e) { e.printStackTrace(); } smooth(); font = loadFont("MyriadPro-Regular-24.vlw"); textFont(font); frameRate(25); cap = new Capture(this, width, height); noStroke(); } void draw() { background(0); image(cap, 0, 0); fill(255, 255, 0); text("Attention: "+attention, 20, 150); fill(255, 255, 0, 160); rect(200, 130, attention*3, 40); fill(255, 255, 0); text("Meditation: "+meditation, 20, 250); fill(255, 255, 0, 160); rect(200, 230, meditation*3, 40); if (blink>0) { fill(255, 255, 0); text("Blink: " + blinkSt, 20, 350); if (blink>15) { blink = 0; } else { blink++; } } } void captureEvent(Capture _c) { _c.read(); } void attentionEvent(int attentionLevel) { attention = attentionLevel; } void meditationEvent(int meditationLevel) { meditation = meditationLevel; } void blinkEvent(int blinkStrength) { blinkSt = blinkStrength; blink = 1; } void stop() { neuroSocket.stop(); super.stop(); } |
Nanobot Music
Here is a distributed robotic controlled music performance. It is a research project from the University of Pennsylvania.
From Cool Hunting.