I am fairly new to processing and to coding in general so I’m having a hard time, figuring this out.
I am currently working on a video installation that is supposed to film someone standing on a marked spot. The live video should then be split up into at least 3 parts (say head, torso, legs(doesn’t need to be accurate)) who are then rearranged so that for example the head and legs are switched. Or some parts could be flipped horizontally.
I know how to get the video of the webcam into processing and how to rotate it and all those things. But I just can’t figure out any way I can split up the video and rearrange it.
Do you have any tips on a way to approach this or anything I could look into? Is it even possible to do this in processing? Is there a software that could do this better(I want to add graphic overlays as well)
The concept is this. You get your image from your video stream and store it in a PImage object. Then you can use get to extract a section of the image. What you want to do is to create 3 PImage objects that will have your head, torso and legs sections of your images. Now, instead of drawing your main (video) image into the sketch, you can use the different fragments like this:
image(torsoPImage, posx, posy);
Where the positions are specified by you. You mix these calls with rotations or even translations to reposition your segment in your canvas. You need to use pul/push functions in order to reposition the segments independently from the other segments. The tutorial above will explain the concept if you are not familiar with them. Positioning a segment would look something like this:
Also check out the version of image() that takes 9 parameters - image, destination rectangle, source coordinates. This will be more efficient than using get().