Myron/WebCamXtra Motion Detection ¤ Color Tracking ¤ Glob Distinction ¤ Pixel Adressing ¤ For the Common Man




Home
Download
SVN
Reference
Learning

Join Email List
Messageboards
Report Bugs
Request Features
FAQ
Screenshots
RSS Feeds

Credits

Donations
Reference


System

start

stop
update
settings
version
hijack
Pixels

image

cameraImage

Color

trackColor
trackNotColor
average

sensitivity
Motion

retinaImage
differenceImage
adaptivity
adapt
Glob

findGlobs
globCenters
globBoxes
globEdgePoints
globQuads
globPixels

globsImage
minDensity
maxDensity


void start(int width,int height) initializes the xtra. This should be the first function you call just following instantiation, otherwise the plugin will malfunction.

lingo:
myron = new xtra("webcamxtra")
myron.start(320,240)
 

Processing / Java:
JMyron m = new JMyron();
m.start(320,240);
 

void stop() 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() is called once per frame in order to run the vision processing and camera updating.

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

String version() returns the version of WebCamXtra as a string.



void trackColor(red,green,blue,tolerance) and trackNotColor(red,green,blue,tolerance) will tell webcamxtra 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)

The plugin is not defaultly watching for motion events, but this can be enabled by setting adaptivity to something other than the default 0. Try setting it to 2, and then track the color white. Glob processing will always be run on the differenceImage.

void adaptivity(float val) 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.


PIXELS

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() returns the regular camera image object.

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

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

differenceImage() returns the difference image - an image useful in determining motion.

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


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) if state is 0, glob processing is disabled. if state is 1, then glob processing is enabled. Parts of webcamxtra 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]

minDensity(int val) and maxDensity(int val) will change the minimum and maximum pixel-counts for "acceptable" globs.

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]


SourceForge.net Logo