Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Static Noise With Video

$
0
0

Hey processing world!

Still very new at this so I apologize in advance. I took a few different codes from online and I want to combine them together to make my camera on my laptop control the static. I pretty much want the shadow of a human figure or object to be seen underneath (or on top of the static). Anytime I do this however, I cant figure out how to get the data to read with a static image that's moving.

import processing.video.*;
Capture video;

int videoScale=10;
void setup() {

  frameRate(10);
  size(512, 512); 
  video = new Capture(this);  
  video.start();
}
void captureEvent(Capture video) {
  video.read();
}
void draw() {
  background(0);
  video.loadPixels();  

  loadPixels();
  for (int x = 0; x < width; x++) {
    for (int y = 0; y < height; y++) {
      float randomValue = random(255)*videoScale;
      pixels[x+y*width] = color(randomValue, randomValue, randomValue);

  }
  updatePixels();
  }}

Viewing all articles
Browse latest Browse all 2896

Trending Articles