Some technical info:


Most of the projects, unless otherwise mentioned, are created using openFrameworks, which coded with C++ and uses openGL for graphic rendering. They all run on iMac. openFrameworks has a Windows version, so the source code could be adapted to Windows, if needed. I uses functions provided by openFrameworks, and make openGL API calls if writing the code is not too time consuming, so that I can have full control and knows what is going on. This, in my experience, save me some time in debugging through issues. 

I have to thanks the openFrameworks community and the active participants in the openFrameworks forum, who post their answers to many questions with code snippets and examples. The posts already there are also really useful. Just by reading through them saves me lots of time.

Here are some more technical information about each project:

  • WEAVING SPHERE:
    • For the hand tracking part, it uses a depth sensor to obtain the depth data. Then uses background learning and comparison to process the depth data before blob detection, with some additional processing to increase the accuracy of locating the hand position. ofxOpenCV and ofxCv are used for accessing OpenCV capabilities.
    • Since the program essentially uses background comparison, so there are quite some flexibilities in where to place the depth sensor. The view axis of depth sensor does not has to be perpendicular to the wall surface. In this project, I placed the depth sensor slightly in front of the projector, and at a slanted position with the wall surface. The projector and depth sensor could both as well be placed at the ceiling in front of the wall.
    • Since the program essentially uses background comparison, it is flexible and can work on other walls or flat surfaces. The setup calibration processing is simple and involves just pressing a couple of keys and takes less than 2 minutes. The program automatically finds the 4 corners of the projected area in the depth map, warps it back to the physical projected area, and starts the background learning process. The unregistered depth map was used so that the usable area can be larger. I find the area with no depth data in the registered depth map too large to waste.
    • Using the process similar to RGBDemo, I have created codes with openFrameworks for the calibration of the sensor (RGB camera + IR camera) and projector, including the distortion of camera and projector (if any), but this is basically for another project, not really necessary for this hand tracking.
    • The threads are generated parametrically including randomness factors.
  • RUNNING LINES:
    • Although openFrameworks has some addons that can perform 2D projection-mapping of textures to physical objects, but for more flexibility and control in drawing customized graphics I like, I picked up some codes from ofxMpplrExample, modified them and created a basic interface for my projection mapping.  
    • After obtaining measurements of the scene, the codes can be easily adapted for projecting mapping on other scene geometries also. Just for those who might not know, as this is projection mapping and performs a 2D to 2D perspective warping using homography, the projector basically can be placed at different positions, just that the polygons need to be mapped again with mouse drag and click (But certainly, the scene geometries need to be considered together with the placement of projector position. For example, to avoid the projector lens' axis making an angle too small with the physical surface, causing severe aliasing issue).
    • For mapping to irregular curved mesh surfaces, I have created a demo program for texture UV mapping using geodesic distance, and will clean it up and upload the demo later. But this is for irregular curved surface, not necessary for RUNNING LINES, in which there are only flat surfaces.
    • The lines are generated parametrically including randomness factors. The lines run in one of the polygons until intersection of line and the polygon bound is detected, then restarted or continued in a neighbouring/suitable polygon. 
    • I still trying to find a way that can generate some sort of random plane curve nicely, but not found one yet.
  • RUNNING TEXT LINES:
  • NEONS:
  • RECEDING RECTANGLES:
  • TEXT IMAGES:
    • I tried using sum area table to speed up the averaging calculation of image areas to achieve a higher real-time frame rate, but the speed gain was actually not that significant. The bottle neck is actually in text rendering. If applying the effect to video instantly, the frame rate can be almost real-time for a 720p video. It basically can just feed in any image or video of various size; but for 1080p output,  for now I ran it through automatically frame by frame to add to the output movie.
  • CHINESE CHARACTERS:
    • Uses ofxBox2d (a wrapper for box2d for openFrameworks) for physics simulation.
    • The hand tracking part is similar to WEAVING SPHERE above.
  • GREEN STACK & SHADOWS:
    • The program basically uses VSM shadow mapping. 
    • Uses geometry instancing to generate a shadow map for each light and then add the shadow together. There are total 6 lights in this case. Depending on the size of shadow maps needs, with some optimizations, I think this method should be able to handle many more lights at real-time frame rate.
  • BLURRED DOTS:
    • It uses the RGB + depth sensor device to track the head position. Then draw the dots based on the head position.
  • SWIMMING POOL:
    • Uses geometry shader to generate sets of vertices from Snell's law's refracted rays for the caustic pattern and also for the distorted pool tiles image. Similar to other projects, this is for artistic purpose, not for exact physics simulation
    • The hand tracking part is similar to WEAVING SPHERE above.
  • OLD BRICKS:
    • Uses ofxBox2d (a wrapper for box2d for openFrameworks) for physics simulation.
    • The hand tracking part is similar to WEAVING SPHERE above.
  • TWO VANISHING POINTS:

    • It  adds some additional vertex position manipulation before passing to the pipeline to create an effect similar to 2 points perspective.

Some openFrameworks addons commonly used in the projects include ofxGlmTools, ofxCv, ofxVideoRecord and ofxXmlSettings.