xxxxxxxxxx
19
let capture;
function setup() {
createCanvas(1440, 900);
// Create the video capture and hide the element.
capture = createCapture(VIDEO);
capture.hide();
describe('A video stream from the webcam with inverted colors.');
}
function draw() {
// Draw the video capture within the canvas.
image(capture, 0, 0, width, width * capture.height / capture.width);
// Invert the colors in the stream.
// filter(INVERT);
}