Tech Tips

  1. 未分類
  2. 13 view

[Processing]How to use Camera

Outline

Try to develop program which use camera and draw the image to make AR app in the future.

Source Code

The source code is following.
It’s very easy to make it with Processing. How useful!
import processing.video.*;

// Definition camera device interface
Capture cam;

void setup() {
  // Set size
  size(640,480,P3D);
  // Create camera device interface
  cam = new Capture(this, width, height);
}

void draw() {
  // Check whether camera is available
  if (cam.available() == false) return;
  // Get camera image
  cam.read();
  // Draw camera image
  background(0);
  image(cam, 0, 0, width, height);
}

Result

camera
The result is like following.
Of course, actually, the result is movie.

未分類 recent post

  1. Install sbt 1.0.0 and run sample template

  2. Visualization of Neural Network and its Train…

  3. [Machine Learning]Created docker image includ…

  4. [Node.js]How to write batch script with Node.…

  5. Web Server Contribution by Vagrant and Ansibl…

関連記事

PAGE TOP