interactive floor

Specifically, what I’m trying to do is something like “walking on water” with water ripple effect.
I’m trying to do this with Touchlib ( with DirectX in one solution file, but I don’t know which cpp and header files must be included and where in source code can play with size of blobs (for tracking people).
Instead of the mouse triggering the ripples, I would like to trigger with person shadow…

I saw Chris O’Shea Audience project which probably use Optical Flow Algorithm…
Which technique is better and have less latency?

I’m on Visual Studio C++ 2005 and have unmodified PS3Eye cam…
If someone can share some source code for Windows I would deeply appreciate it!

Best Regards!

if you have a look at the ofxOpenCv example in the addon examples folder it should demonstrate how to do this kinda stuff without using touchlib at all. hope that helps.

Thanx memo!

But does anyone have example (for Windows) with ofxOpenCv where blobs trigger action instead of the mouse?

I have found a interactive floor project made by students of Interacting Design at Chalmers University……-lcome.html

Unfortunately, it’s only for Linux and MacOSX…

Have someone experimented with interactive floor in Windows environment ??


Hey - looking through your previous posts on this forum I notice a lot of “can you share the source code for …”

There is a lot of helpful people on this forum and a lot of very useful code posted too, there is more than enough resources for you to figure out how to make what you want but don’t expect all the code to be handed to you from other people’s projects.

Memo’s suggestion of looking at the ofxOpenCv example is a good start and if you had bothered to check it out you would know that all the examples are Mac / Windows and Linux compatible.

I suggest you download the latest OF for windows - there is a Visual Studio package here: (the FAT release has ofxOpenCv).


Sorry, but I don’t find nowhere how to trigger some action with blob avoiding latency and reduce CPU demand…
In my opinion, this requires more skill…

[quote author=“potter3366”]I have found a interactive floor project made by students of Interacting Design at Chalmers University……-lcome.html

Unfortunately, it’s only for Linux and MacOSX…

Have someone experimented with interactive floor in Windows environment ??


the link which you post here,i don’t think its really hard porting to win32. :stuck_out_tongue:

this is code from a demo I was working on and was hoping to release a while ago, but never finished it.

ofVideoGrabber			vidGrabber;			// video input  
ofxCvColorImage			captureImage;		// copy of original image from camera input (color)  
ofxCvGrayscaleImage 	currentGrey;		// greyscale version of camera input, flipped if nessecary  
ofxCvGrayscaleImage 	cleanPlate;			// saved clean plate (just background, without foreground)  
ofxCvGrayscaleImage		backgroundDiff;		// difference between current frame and clean plate  
void testApp::setup() {  
	// initialize video grabber  
	vidGrabber.initGrabber(320, 240);	  
	// allocate space for all images  
	captureImage.allocate(vidGrabber.width, vidGrabber.height);  
	currentGrey.allocate(vidGrabber.width, vidGrabber.height);  
	cleanPlate.allocate(vidGrabber.width, vidGrabber.height);  
	backgroundDiff.allocate(vidGrabber.width, vidGrabber.height);  
void testApp::update() {  
	// query grabber for new frame	  
	if(vidGrabber.isFrameNew()) {		// if there is a new frame  
		// save it in original image, and flip if nessacary  
		captureImage	= vidGrabber.getPixels();		  
		if(bMirror) captureImage.mirror(false, true);  
		// convert color image to grey  
        currentGrey		= captureImage;	  
		// take snapshot for clean plate   
		if(doSaveCleanPlate) {						  
			cleanPlate = currentGrey;  
			doSaveCleanPlate = false;  
		// subtract cleanplate from current image to get difference  
		backgroundDiff.absDiff(cleanPlate, currentGrey);  
		// blur diff a bit  
		if(preDiffBlurAmount) backgroundDiff.blur(preDiffBlurAmount*2 + 1);	// amount has to be odd  
		// apply threshold  

then you can use backgroundDiff.countNonZeroInRegion(x, y, w, h);
to count the number of nonzero pixels in that region. if the return value is greater than a threshold (and the action isn’t already running), trigger the action.

You don’t even need to track blobs (detect contours), just check the differenced image as mentioned above.

P.S. maybe we can look into a geshi style syntax highlighting filter plugin for the forum? :stuck_out_tongue:

Thanx memo!

I have starting point now :slight_smile:
Just one question - It’s better to use 2 PC, one to get data (count the number of nonzero pixels in region) and one to create interactive scenario?
Does OpenFrameworks can communicate via TCP/IP with Flash and DirectX application?


Hey, i have also been working on an interactive floor using vvvv (i barely knew of the existance of openframeworks at the time) here are the articles
The video :
For this we made our own application with openCv but since it’s just plain blob detection, it can be done with of fairly easly.

One thing though, we did not have alot of height above the ground so we had to do blog approximations but it all worked nicely :slight_smile:

And i think it might be better to split detection and rendering otherwise it might be heavy for solely one machine.

On it is mentioned that you have new sensors. Could you share some information about what those are?