I was trying to follow the Coding Train p5 video on image processing but I can't get the images to show up (only video feed draws). I can get an image to display correctly without the loop, but when I put it in the loop the captured images do not display.
The webcam video feed works in both scenarios.
let video;
let pics = [];
var button;
var idx = 0;
function setup() {
createCanvas(160,120);
background(255);
video = createCapture(VIDEO);
video.size(160,120);
button = createButton('shoot pic');
button.mousePressed(shoot);
}
function shoot() {
let img = video.get(0,0,160,120);
pics.push(img);
}
function draw() {
for(var i = 0; i < pics.length; i++) {
image(pics[i], 0, 0);
}
}