参考

b-05 ピクセルを操作する - Processing 学習ノート
b-06 ライブカメラを使う - Processing 学習ノート
Capture \ Language (API) \ Processing 3+


合わせて、RGBを取得するのを確かめたくて、あわててかいたソース

import processing.video.*;
Capture camera;

void setup() {
  size(480, 320);
  camera = new Capture(this, width, height, 12);
  smooth();
  noStroke();
}

void draw() {
  background(0);
  camera.loadPixels(); //カメラ画像のpixel情報を読み込み
  int d = 10; //円の直径を定義
  // ライブカメラの映像から、円の直径の間隔ごとに、色情報を取得し、その色で円を描く
  color c;
  float r = 0;
  float g = 0;
  float b = 0;
  for(int y = d / 2 ; y < height ; y += d) {
    for(int x = d / 2 ; x < width ; x += d) {
//      fill(camera.pixels[y * width + x]);
//      ellipse(x, y, d, d);
      c = camera.pixels[y * width + x];
      r = red(c);
      g = green(c);
      b = blue(c);
    }
  }
  text(r + ",  " + g + ",  " + b, 10, 10);
} 

void captureEvent(Capture camera) {
  camera.read();
}