2010年10月8日 星期五

Processing連接Camera(October 3, 2009 )

http://processing.org/learning/libraries/gettingstartedcapture.html

以下為官網的程式

import processing.video.*;

Capture cam;

void setup() {
size(640, 480);

// If no device is specified, will just use the default.
cam = new Capture(this, 320, 240);

// To use another device (i.e. if the default device causes an error),
// list all available capture devices to the console to find your camera.
//String[] devices = Capture.list();
//println(devices);

// Change devices[0] to the proper index for your camera.
//cam = new Capture(this, width, height, devices[0]);

// Opens the settings page for this capture device.
//camera.settings();
}


void draw() {
if (cam.available() == true) {
cam.read();
image(cam, 160, 100);
// The following does the same, and is faster when just drawing the image
// without any additional resizing, transformations, or tint.
//set(160, 100, cam);
}
}



=============

看起來好像可以接連到camera

但後來發現會出現VDIG的error

於是到 http://www.eden.net.nz/7/20071008/ 下載VDIG來安裝

安裝前有先裝完了quicktime 因為好像需要

下載1.0.5版的好像不能使用@~@

後來抓了1.0.1版本後 就正常可以連接上camera了

沒有留言: