We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpVideo Capture,  Movie Playback,  Vision Libraries › code help: replacing user with video using webcam
Page Index Toggle Pages: 1
code help: replacing user with video using webcam (Read 861 times)
code help: replacing user with video using webcam
May 10th, 2010, 12:54am
 
I'm trying to make a program using a webcam that replaces you, the user, with a videoclip while the background stays what it is.  So far I have made this:

import processing.video.*;
Movie myMovie;

void setup () {
 size(720, 480, P3D);
 myMovie = new Movie(this, "nigara10sd.mov");
 myMovie.loop();
}

void movieEvent(Movie movie) {
 movie.read();
}

void draw() {
 image(myMovie, 0, 0);
 background(#FFFFFF);
}

Where "nigara10sd.mov" is is the name of the videoclip that will be replacing the user.  As you can see I've put a white background over the top so the video playing underneath won't be revealed until the user steps in front of the webcam.  

I've found a tutorial where the background is replaced with an image so the user looks like their in a different location, but i kinda want to do the opposite and replace the user with the background, in this case a video not an image, instead.

Hope I haven't confused anyone.  Any help would be appreciated!
Page Index Toggle Pages: 1