In this week , we as a class learnt how to work with image,videos and cam feed and make use of them in a sketch.
I used the camera feed and an image for my sketch. The image is uploaded on the canvas using a predefined function called preload() and the camera feed is captured in setup using a global variable called cam.
To rescale the camera feed ive declared a global variable called vScale and set it to 20 and then using cam.size () function , the width and height of the camera capture is resized. To resize the image , there is a predefined function which is Image.resize().
In the draw function , we first load pixels and iterate through the width and height of canvas using for loop .
The index variable stores the right most pixel on the canvas . The bright variable is declared to store the average of r,g,b.
using the if statement : if( bright >100 ) , ive made the sketch interactive.
hope you like it !
https://editor.p5js.org/ShauryaSeth/sketches/gW5I89aMW