Join Email List
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.
myron = new xtra("webcamxtra")
Processing / Java:
JMyron m = new JMyron();
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.
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.
returns a list of bounding boxes for each glob.
this is a list of rects.
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.
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
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.