Hello! I'm new to Processing, and am making an installation project based on Muybridge image sequences. I want to capture images of people jumping, and play the images back randomly in a grid. I have the basic code and steps outlined, I'm just not sure what the missing pieces are.
Steps:
-capture (saveFrame) is supposed to be set off by a tilt switch (Arduino)
-saved frames sent with naming convention to a folder called jump (would overwrite after 500 images)
-images are called back into a grid of 10 x 10 images. This is to display the jump states of various people together in a grid
My questions are:
- if it's possible to capture as well as call back images to display at the same time. I tried with a second camera.
- how to capture images at 640 x 480 and resize to the grid of 10 x 10 (64 x 48)
I'll copy both the code for the image capture/ serial event and the image grid below. Any help would be really appreciated. Thanks in advance.
GRID:
import processing.video.*; // video library
int maxImages = 16; // Total # of images (will be more)
int imageIndex = 0; // Initial image to be displayed is the first
// Declaring an array of images.
PImage[] images = new PImage[maxImages];
ImageGrid grid;
void setup() {
size(640, 480, P2D);
for (int i = 0; i < images.length; i ++ ) {
images[i] = loadImage("jump" + nf(i,3) + ".jpg" );
}
frameRate(5);
grid = new ImageGrid(images,10,10);
}
void draw() {
background(0);
grid.draw(imageIndex);
// increment image index by one each cycle
// use modulo " % "to return to 0 once the end of the array is reached
imageIndex = (imageIndex + 1) % images.length;
}
class ImageGrid {
int xSize;
int ySize;
int xTiles;
int yTiles;
int xTile;
int yTile;
int xImagePos;
int yImagePos;
int offset;
PImage[] images;
int imageCount;
ImageGrid(PImage[] tempImages, int tempXtiles, int tempYtiles) {
images = tempImages;
xTiles = tempXtiles;
yTiles = tempYtiles;
}