Image in front of video
in
Core Library Questions
•
1 year ago
Hello,
Here I am again. I've got a little problem. I've got the following idea: I want that processing makes a picture (of your shadow which is projected on a white wall), saves it in the data directory, put it back into processing with a blendmode (the white wall will be subtracted, and only your silhouette will be displayed) and BEHIND this silhouette I want to play a video.
But the problem is that the picture from the silhouette is been shown behind the video, instead of the silhoutte in front of the video.
a = a white background
b = the picture which is made with the webcam
This is the code till now:
___________________________________________________________________
import processing.video.*;
Capture myCapture;
PImage a, b;
Movie theMov;
void setup() {
size(640, 480, P2D);
a = loadImage("bg3.jpg");
b = loadImage("plaatje.jpg");
theMov = new Movie(this, "film.mov");
{myCapture = new Capture(this, width, height, 30);
}
}
void captureEvent (Capture myCapture) {
myCapture.read ();
}
void draw() {
image(theMov,0,0);
}
void movieEvent(Movie m) {
m.read();
}
void mousePressed() {
image(myCapture, 0, 0);
saveFrame("data/plaatje.jpg");
delay(300);
myCapture.stop();
image(theMov,0,0);
theMov.play();
aplhaImage();
}
void aplhaImage(){
for (int i = 0; i < 4; i = i+1) {
blend(b, 0, 0, 640, 480, 0, 0, 640, 480, MULTIPLY);
}
}
___________________________________________________________________
Thanks for te one who will help me! I'm not very practised in Processing.
Here I am again. I've got a little problem. I've got the following idea: I want that processing makes a picture (of your shadow which is projected on a white wall), saves it in the data directory, put it back into processing with a blendmode (the white wall will be subtracted, and only your silhouette will be displayed) and BEHIND this silhouette I want to play a video.
But the problem is that the picture from the silhouette is been shown behind the video, instead of the silhoutte in front of the video.
a = a white background
b = the picture which is made with the webcam
This is the code till now:
___________________________________________________________________
import processing.video.*;
Capture myCapture;
PImage a, b;
Movie theMov;
void setup() {
size(640, 480, P2D);
a = loadImage("bg3.jpg");
b = loadImage("plaatje.jpg");
theMov = new Movie(this, "film.mov");
{myCapture = new Capture(this, width, height, 30);
}
}
void captureEvent (Capture myCapture) {
myCapture.read ();
}
void draw() {
image(theMov,0,0);
}
void movieEvent(Movie m) {
m.read();
}
void mousePressed() {
image(myCapture, 0, 0);
saveFrame("data/plaatje.jpg");
delay(300);
myCapture.stop();
image(theMov,0,0);
theMov.play();
aplhaImage();
}
void aplhaImage(){
for (int i = 0; i < 4; i = i+1) {
blend(b, 0, 0, 640, 480, 0, 0, 640, 480, MULTIPLY);
}
}
___________________________________________________________________
Thanks for te one who will help me! I'm not very practised in Processing.
1