I've tried a lot of time to store in a variable a frame from the webcam, but it doesn't work. The goal is to compare two consecutive frames from the video, so I need to store two frames in two variables, but storing one is already harder that what I thought.. Here's the code that corresponds to this problem:
import processing.video.*;
Capture video;
PImage image1;
void setup() {
size(1280, 960);
println("Caméras disponibles : ");
printArray(Capture.list());
video = new Capture(this, Capture.list()[75]);
video.start();
}
void draw() {
if (video.available() == true) {
video.read();
image1 = video;
}
image(image1, 0, 0);
}
It works fine when I write image(video, 0, 0); but as soon as I try to replace it by the variable image1, it doesn't print anything. Hence, the problem is the third line...
Would anyone have an idea of what is going on?
Thanks in advance!
videois not available? What will the value ofimage1be? - Kevin Workman