Static Noise With Video

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();
  }}

Answers

  • Edit post, highlight code, press Ctrl-o to format.

    God, I'm so sick of typing that.

  • Got it. Done.

  • Not the solution final but here it goes: it is very unlikely your camera's dimension matches your sketch size. Instead use video.width and video.height in your for loops

    How are you detecting your shadows?

    Kf

Sign In or Register to comment.