How to use SPOUT input with 11.10: Computer Vision: Adding Lifespan to Blobs - Processing Tutorial

Hello @marijn,

I was able to integrate my example:

// In setup()
video = createImage(640, 360, RGB);

//in draw()
  video = spout.receiveTexture(video);
  image(video, 0, 0);
  loadPixels();
  arrayCopy(pixels, video.pixels); // Makes a copy to work with

This will also work:

void draw() {
  
  video = spout.receiveTexture(video);
  image(video, 0, 0);
  loadPixels();

  ArrayList<Blob> currentBlobs = new ArrayList<Blob>();

  // Begin loop to walk through every pixel
  for (int x = 0; x < width; x++ ) {
    for (int y = 0; y < height; y++ ) {
      int loc = x + y * width;
      // What is current color
      color currentColor = pixels[loc];

// ...

If you set the maximum textSize() you are using in setup() the text in draw() won’t be blurry.

image

:)