OpenCV
ArGaze provides a ready-made contexts to process cursor position over Open CV window and process movie images.
To select a desired context, the JSON samples have to be edited and saved inside an ArContext configuration file. Notice that the pipeline entry is mandatory.
{
JSON sample
"pipeline": ...
}
Read more about ArContext base class in code reference.
Cursor
Bases: ArFeatures.ArContext
Capture cursor position over OpenCV window.
Warning
It is assumed that an OpenCV window with the same name than the context is used to display context's pipeline image.
JSON sample
{
"argaze.utils.contexts.OpenCV.Cursor": {
"name": "Open CV cursor",
"pipeline": ...
}
}
Movie
Bases: Cursor
, ArFeatures.DataPlaybackContext
Playback movie images and capture cursor position over OpenCV window.
Warning
It is assumed that an OpenCV window with the same name than the context is used to display context's pipeline image.
duration: int | float
property
Get movie duration.
path: str
property
writable
Movie file path.
progression: float
property
Get movie playback progression between 0 and 1.
JSON sample
{
"argaze.utils.contexts.OpenCV.Movie": {
"name": "Open CV movie",
"path": "./src/argaze/utils/demo/tobii_record/segments/1/fullstream.mp4",
"pipeline": ...
}
}
Camera
Bases: Cursor
, ArFeatures.DataCaptureContext
Capture camera images and capture cursor position over OpenCV window.
Warning
It is assumed that an OpenCV window with the same name than the context is used to display context's pipeline image.
identifier: int
property
writable
Camera device id.
JSON sample
{
"argaze.utils.contexts.OpenCV.Camera": {
"name": "Open CV camera",
"identifier": 0,
"pipeline": ...
}
}