I came across this video from memo.tv. It is an analog version of pendulum drawing with algorithmic art, very beautiful indeed.
People Detection Sample from OpenCV
There are a number of requests of the code I adopt the OpenCV people detection sample. Here it is.
#include <opencv2/opencv.hpp> using namespace cv; int main (int argc, const char * argv[]) { VideoCapture cap(0); cap.set(CV_CAP_PROP_FRAME_WIDTH, 320); cap.set(CV_CAP_PROP_FRAME_HEIGHT, 240); if (!cap.isOpened()) return -1; Mat img; namedWindow("opencv", CV_WINDOW_AUTOSIZE); HOGDescriptor hog; hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector()); while (true) { cap >> img; if (img.empty()) continue; vector<Rect> found, found_filtered; hog.detectMultiScale(img, found, 0, Size(8,8), Size(32,32), 1.05, 2); size_t i, j; for (i=0; i<found.size(); i++) { Rect r = found[i]; for (j=0; j<found.size(); j++) if (j!=i && (r & found[j]) == r) break; if (j== found.size()) found_filtered.push_back(r); } for (i=0; i<found_filtered.size(); i++) { Rect r = found_filtered[i]; r.x += cvRound(r.width*0.1); r.width = cvRound(r.width*0.8); r.y += cvRound(r.height*0.07); r.height = cvRound(r.height*0.8); rectangle(img, r.tl(), r.br(), Scalar(0,255,0), 3); } imshow("opencv", img); if (waitKey(10)>=0) break; } return 0; } |
Another Particles System Exercise in TouchDesigner
Here is the second particles system exercise in TouchDesigner. In this version, the particles are 3D SOP boxes.
Feedback Usage in TouchDesigner
It is a more simple demonstration of using the Feedback texture operator (TOP) in TouchDesigner. Again, it has only visual at the moment.
TouchDesigner Particles System
This is an introductory tutorial for creating particles system in TouchDesigner. At the moment, it only has visual imagery. I’ll try to add audio for the explanation later.
PTAM Trial Run
Kinect Typography
It is a class for the School of Design.
Reference


Presentation material
Hello World
It is the name of a documentary on open source programming art practices.
People Detection in OpenCV again
There are a number of enquiries about the people detection video I did a while ago. It is a step by step explanation of what I have done. I use the XCode 4 in OSX Lion with OpenCV 2.3 to try out the following.
The first step is to download and build the latest OpenCV 2.3 into the folder at /Developer/OpenCV-2.3.0. The headers are in the include folder. Please note that you may have to copy the individual include folders from the modules folder. I build the shared libraries in the lib/Release folder.
The code is a modification of the sample peopledetect.cpp.
The second step is to display the video capture image. I use the example from the C++ reference manual in the highgui section.
#include <iostream> #include <opencv2/opencv.hpp> using namespace std; using namespace cv; int main (int argc, const char * argv[]) { VideoCapture cap(CV_CAP_ANY); if (!cap.isOpened()) return -1; Mat img; namedWindow("video capture", CV_WINDOW_AUTOSIZE); while (true) { cap >> img; imshow("video capture", img); if (waitKey(10) >= 0) break; } return 0; } |
The last step is to combine the two examples into one, with a little adjustment of the detection parameters and the display rectangle size.
#include <iostream> #include <opencv2/opencv.hpp> using namespace std; using namespace cv; int main (int argc, const char * argv[]) { VideoCapture cap(CV_CAP_ANY); cap.set(CV_CAP_PROP_FRAME_WIDTH, 320); cap.set(CV_CAP_PROP_FRAME_HEIGHT, 240); if (!cap.isOpened()) return -1; Mat img; HOGDescriptor hog; hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector()); namedWindow("video capture", CV_WINDOW_AUTOSIZE); while (true) { cap >> img; if (!img.data) continue; vector<Rect> found, found_filtered; hog.detectMultiScale(img, found, 0, Size(8,8), Size(32,32), 1.05, 2); size_t i, j; for (i=0; i<found.size(); i++) { Rect r = found[i]; for (j=0; j<found.size(); j++) if (j!=i && (r & found[j])==r) break; if (j==found.size()) found_filtered.push_back(r); } for (i=0; i<found_filtered.size(); i++) { Rect r = found_filtered[i]; r.x += cvRound(r.width*0.1); r.width = cvRound(r.width*0.8); r.y += cvRound(r.height*0.06); r.height = cvRound(r.height*0.9); rectangle(img, r.tl(), r.br(), cv::Scalar(0,255,0), 2); } imshow("video capture", img); if (waitKey(20) >= 0) break; } return 0; } |
Please note that the performance is pretty slow even though the capture size is 320 x 240.