プログラミング + アカデミック + 何か面白いこと

  1. Programming
  2. 1 view

[Processing]How to use Camera

Pocket

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

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

Pocket

Programming recent post

  1. Install sbt 1.0.0 and run sample template

  2. [Machine Learning]Created docker image includ…

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

  4. [Play][Scala]Develop Request Driven Batch Usi…

  5. [OpenCV][Ruby]Auto check web page design corr…

関連記事

PAGE TOP