proce55ing/JMyronリファレンス(一部日本語化)

Last-modified: 2009-02-02 (月) 12:38:18

リファレンス一覧



System

void start(int width,int height)

xtra を初期化する。 jmyron をインスタンス化する際は必ず最初に実行しなければならない。
でないとプラグインが故障誤作動する。
width, height はカメラの幅と高さ。

initializes the xtra. This should be the first function you call just following instantiation, otherwise the plugin will malfunction.


void stop()

動画の最後で xtra を閉じる。この関数を呼ばないと、次に再び動画をスタートできなくなる。

will close the xtra at the end of your movie. call this or else you won't be able to call start again when the movie plays the next time.


void update()

カメラのアップデートや処理の進行のために、1フレームごとに呼ぶ。

is called once per frame in order to run the vision processing and camera updating.


void settings()

カメラの設定を変更するための各OSのユーザーダイアログウインドウを開く。この設定は持続し続ける。

will open the OS's user dialog window that lets you change the camera's settings. These settings will remain persistent between


String version()

Web Cam Xtraのバージョンを string で返す。

returns the version of Web Cam Xtra as a string.



void hijack(newimage)

replaces the camera's view with a lingo image object of your choice. This is good if you want to hijack web cam xtra and run it on your own graphics or video footage without actually using the "web cam" part of it. One hijack call will replace the image for only one subsequent call to update().



Pixels



Processing では、返されるイメージは width * height の int 配列です。
これは Processing の "pixels" 配列と同じフォーマットです。
Director では、返されるイメージは "Image Lingo" というイメージオブジェクトです。
CopyPixels() を用いるとこのイメージをビットマップスプライト(?)に入れることができるので、それをステージに書き込みます。

In Processing, returned images are int arrays whose item lengths are the width*height. This is the same format as the Processing "pixels" array.

In Director, returned images are "Image Lingo" image objects. By using CopyPixels(), one can place this image into a bitmap sprite, or paint it to the stage.


cameraImage() or image()

カメラからキャプチャされた画像のオブジェクトを返す。
ex. int[] img = m.image();

returns the regular camera image object.



Color

void trackColor(red,green,blue,tolerance) and trackNotColor(red,green,blue,tolerance)

globs で探してほしい色を web cam xtra に伝える。
tolerance ではカラーマッチングの "感度" を設定する。

will tell web cam xtra which color you want it to match when it's looking for globs. Tolerance will set the "sensitivity" of the color matching (or not matching).


average(int left,int top,int right,int bottom)

will average a given rect of pixels in the differenceImage and return the overall color. The return is a color. In Lingo, this is a color object. In Processing, this is an single integer color, whose color channel values can be retrieved using the functions red(), green(), and blue().


sensitivity(float value)

changes the trackColor tolerance (otherwise known as feathering or thresholding)



Motion

retinaImage()

this returns the retina image (the image slowly adapting to the camera, used for motion)


differenceImage()

difference image (変化した部分のみの画像)を返します。動きに関する処理などに役立ちます。

returns the difference image - an image useful in determining motion.


void adaptivity(float val)

  • (訳注)英文よくわかんない!たすけてえらい人><
    retaina(直訳では網膜)に画像を適応する速度を設定します。デフォルトでは 0 。
    retinaは、過去のフレームを格納しておくところです。 differenceImage を計算するために、 cameraImage と比較するのに使ったりします。
    動き検知とかに役立ちます。

    sets the speed at which the retina image adapts. set this to 0 to have no adaptivity at all. default is 0. The retina is where the past frames are stored- waiting for comparison with the cameraImage in order to calculate the differenceImage - which is a product most useful in detecting motion, and movement on a non-solid background.


void adapt()

tells the retinaImage to immediately adapt, completely, to the camera image. This is useful to call at the beginning of the program.



Glob


Glob will analyze the scene with the help of your parameters, and return a list of geometries concerning the multiple objects in the camera's view. Glob processing is always run on the differenceImage, which is defaultly equivalent to the plain image of the camera. (See MOTION)


findGlobs(int state)

state に 0 を入れると、グラブ処理の利用を停止する。1 を入れると、グラブ処理を可能にする。
グラブ処理の使用を停止すると、globsImage, globsQuads, globBoxes など web cam xtra の一部が停止する。
これはフレームレートの増加に良い効果をもたらす。

if state is 0, glob processing is disabled. if state is 1, then glob processing is enabled. Parts of web cam xtra will become inactive when you disable globs, such as globsImage, globQuads, globBoxes, etc. This is good for increasing the framerate!


globCenters()

グラブから得た中心点をリストで返す。
これは点のリストである。

returns a list of center points for each glob.
this is a list of points.
Lingo: [point,point,point]
Java: int[][2]


globBoxes()

returns a list of bounding boxes for each glob.
this is a list of rects.
Lingo: [rect,rect,rect]
Java: int[][4]


globEdgePoints(int segmentLength)

グラブで得られた輪郭を点のリストとして返す。
これはループが作れる経路の点のリストの、リストである。

returns a list of points describing the outlines of each glob. this is a list of lists of points ordered in a loopable path.
Lingo: [[point,point],[point,point,point]]
Java: int[][][2]


globQuads(int minSide,int maxSide)

returns a list of points describing the closest fitting quads (4-pointed polygons) for each glob. this is a list of quads. A quad is a list of 4 points. This function can be used to determine the directionality of a long object, and the exacting dimensions and rotation of a rectangular object arbirarily rotated in 2D.
Lingo: [quad,quad,quad]
Java: int[][4][2]


globPixels()

returns a list of actual pixel positions for each glob. This is a list of lists of points.
Lingo: [[point,point],[point,point,point]]
Java: int[][][2]


globsImage()

returns an image object with a globs preview. this should only be used for debug purposes.


minDensity(int val) and maxDensity(int val)

グラブで取り得る最小値と最大値を設定する。

will change the minimum and maximum pixel-counts for "acceptable" globs.