This is the original OpenCV people detection example ported to Processing with the Java library of OpenCV 2.4.8. It can achieve more than 20 frames per second. Here is a sample test snapshot.

Continue reading
Motion Template Rendering of Classic Film Sequences
I use the motion template Processing program in the previous post to render a number of classic film sequences from IGN. Through the motion components returned from each frame, I draw a square by picking up the colour of the pixel at that location.
Continue reading
OpenCV Motion Template Example in Processing
The following example ported the original OpenCV motion template sample code in C to Java/Processing. The original source is the motempl.c file in the OpenCV distribution.
The program started using the default video capture device and passed it to the class Motion. It employed the accumulated difference images to segment into different motion regions, delivered back with a list of rectangles, indicating where the motion components are. It then returned to the Processing main program with an ArrayList of the class Result.

Continue reading
Conversion between Processing PImage and OpenCV cv::Mat
This example illustrates the use of the Java version of OpenCV. I built the OpenCV 2.4.8 in Mac OSX 10.9. After building, I copied the following two files to the code folder of the Processing sketch:
- opencv-248.jar
- libopencv_java248.dylib
The program initialised the default video capture device. It converted the PImage first into an OpenCV matrix – Mat. The matrix is duplicated into another copy and then converted back to another PImage for display with the image command.
It can achieve around 60 frame per second in my old iMac. Here is the screenshot.

Continue reading
Build OpenCV 2.4.8 in Mac OSX 10.9
My former post described the steps to build OpenCV from source in OSX. With OSX 10.9 and the latest Xcode 5.0.2, there are changes before I can build the OpenCV again. I refer to this post for the building process.
In this configuration, I do not need to specify in the ccmake command line the C and CXX compiler. For machine with CUDA, I use /usr/bin/clang for the CUDA_HOST_COMPILER option. After the generation phase of the ccmake process, I manually edit the CMakeCache.txt file to alter some more options.
For CUDA_NVCC_FLAGS, the options are -Xcompiler -stdlib=libstdc++; -Xlinker -stdlib=libstdc++
For CMAKE_CXX_FLAGS and CMAKE_EXE_LINKER_FLAGS, the option is -stdlib=libstdc++
The second option will instruct the build process not to use the new C++11 library that may cause compilation errors in openFrameworks.
JavaScript Test
This is a first test with JavaScript canvas in a WordPress post. There is an external script file with the following content.
Continue reading
3D scanning and hosting
Here is a test run with the Skanect software and the 3D model hosting at Sketchfab.
Winnie the Pooh from chungbwc on Sketchfab.
Documentation from Arts News
Movement in Void – A Tribute to TV Buddha
This is the presentation I did in the artist seminar of the exhibition, Movement in Void.