Hey,
I've two different processing scripts in two different documents. One simply takes an pic of what's on the web cam and saves it once the mouse is clicked. The other takes an image and applies a mask and effect to it.
I am looking to combine these so when you do the first one mentioned—and take a picture, then you can click again and import that picture so it can be used with the second part mentioned above. I hope that wasn't confusing.
Been struggling with this for a few hours.
Here's the two scripts
First:
Code:import processing.video.*;
Capture cam;
float x = 0;
float numFrames = 1;
void setup() {
size(640, 480);
cam = new Capture(this, 640, 480);
}
void draw() {
if (cam.available() == true) {
cam.read();
image(cam, 0, 0);
if (mouseButton == LEFT)
saveFrame("1.jpg");
}
}
Second:
Code:// Start Processing Eye
void setup() {
size(640, 480);
}
void draw() {
background(204);
if (mouseButton == LEFT) {
// Get Image, Crop and Copy
PImage cam;
cam = loadImage("1.jpg");
image(cam, 0, 0);
copy(140, 100, 340, 200, 380, 220, 340, 200);
// Mask
PImage snapMask = loadImage("1mask.jpg");
cam.mask(snapMask);
image(cam, 0, 0);
} else {
fill(0);
}
}
Not looking for anyone to do this—just some help.