
|
CMPUT610 Hand-Eye Coordination and Visual Interaction
Martin Jagersand
Department of Computing Science University of
Alberta
|
MexVision
MexVision is a matlab interface to the XVision2 visual tracking libraries. MexVision connects to XVision through pvm, so pvm must be running.
MexVision commands are invoked using the matlab function
MexVision('command',p1,p2,...) where p1..pn are the parameters required for the command.
This version of MexVision is installed in /usr/vis/research/XVision/MexVision.
You need to add this to your matlab path to use it.
To get started try the GUI: In Matlab type "xvui". Other useful commands are
"grabimage" and YUVtoRGB.
MexVision Commands
- 'init': initialize using a ieee1394 camera as the video source
preconditions: video has not already been created
- 'window': create a window to display the video, and use for interactive tracker initialization
preconditions: video has been created
parameters: window title
- 'edge': create an edge tracker and have the user initialize it
preconditions: window has been created
returns: id of the tracker
- 'ssd1' create a translation only ssd Tracker and have the user initialize it
preconditions: window has been created
returns: id of the tracker
- 'ssd2'
create a translating/rotating/scaling ssd tracker and have the user initialize it
preconditions: window has been created
returns: id of the tracker
- 'blob'
create a color blob tracker and have the user initialize it
preconditions: window has been created
returns: id of the tracker
- 'frame'
grab a frame from the video
returns: matrix containing the image (in YUV422 format)
note: use grabimage to get image in
YUV format
- 'framerate': get the current tracking framerate
preconditions: video has been created
returns: the tracking framerate
- 'image': get the transformed image associated with a tracker
preconditions: the tracker exists and is of type ssd2
parameters: the id of the tracker
returns: grayscale image for the tracker
- 'get': get the state of a tracker
preconditions: the tracker exists
parameters: the id of the tracker
returns: vector containing the state of the tracker.
Given no parameters returns all tracked points sorted first after
tracker type (SSD1, SSD2), then tracker number.
Note: Line and color tracker coordinate acess not yet implemented.
- 'delete': remove a tracker
preconditions: the tracker exists
parameters: the id of the tracker
- 'quit': End MexVision
Using MexVision to capture images:
-
Initialize MexVision:
>> MexVision('init');
-
Capture YUV images with
>> im=grabimage;
Convert to RGB with
>> im2=YUVtoRGB(im);
or
>> im2=YUVtoRGB(grabimage);
-
Quit MexVision:
>> MexVision('quit');