Top level control module
- Source:
Methods
(static) addRegression(name) → {webgazer}
adds a new regression module to the list of regression modules, seeding its data from the first regression module
Parameters:
Name | Type | Description |
---|---|---|
name |
string | the string name of the regression module to add |
- Source:
Returns:
this
- Type
- webgazer
(static) addRegressionModule(name, constructor, this)
adds a new regression module so that it can be used by setRegression() and addRegression()
Parameters:
Name | Type | Description |
---|---|---|
name |
string | the new name of the regression |
constructor |
function | the constructor of the regression Object |
this |
webgazer |
- Source:
(static) addTrackerModule(name, constructor) → {webgazer}
adds a new tracker module so that it can be used by setTracker()
Parameters:
Name | Type | Description |
---|---|---|
name |
string | the new name of the tracker |
constructor |
function | the constructor of the curTracker Object |
- Source:
Returns:
this
- Type
- webgazer
(static) begin()
starts all state related to webgazer -> dataLoop, video collection, click listener
- Source:
(static) clearGazeListener() → {webgazer}
removes the callback set by setGazeListener
- Source:
Returns:
this
- Type
- webgazer
(static) detectCompatibility() → {boolean}
returns if the browser is compatible with webgazer
- Source:
Returns:
if browser is compatible
- Type
- boolean
(static) end() → {webgazer}
stops collection of data and removes dom modifications, must call begin() to reset up
- Source:
Returns:
this
- Type
- webgazer
(static) getCurrentPrediction() → {Object|integer|integer|Array}
requests an immediate prediction
- Source:
Returns:
-
prediction - Object containing the prediction data
- Type
- Object
-
prediction.x - the x screen coordinate predicted
- Type
- integer
-
prediction.y - the y screen coordinate predicted
- Type
- integer
-
prediction.all - if regModelIndex is unset, an array of prediction Objects each with correspodning x and y attributes
- Type
- Array
(static) getRegression() → {array}
returns the regression currently in use
- Source:
Returns:
an array of Objects following the regression interface
- Type
- array
(static) getTracker() → {tracker}
returns the tracker currently in use
- Source:
Returns:
an Object following the tracker interface
- Type
- tracker
(static) setGazeListener(listener) → {webgazer}
sets a callback to be executed on every gaze event (currently all time steps)
Parameters:
Name | Type | Description |
---|---|---|
listener |
gazeListener | callback to handle a gaze prediction event |
- Source:
Returns:
this
- Type
- webgazer
(static) setRegression(the) → {webgazer}
sets the regression module and clears any other regression modules
Parameters:
Name | Type | Description |
---|---|---|
the |
string | name of the regression module to use |
- Source:
Returns:
this
- Type
- webgazer
(static) setStaticVideo(videoLoc) → {webgazer}
set a static video file to be used instead of webcam video
Parameters:
Name | Type | Description |
---|---|---|
videoLoc |
string | video file location |
- Source:
Returns:
this
- Type
- webgazer
(static) setTracker(the) → {webgazer}
sets the tracking module
Parameters:
Name | Type | Description |
---|---|---|
the |
string | name of the tracking module to use |
- Source:
Returns:
this
- Type
- webgazer
(static) showPredictionPoints() → {webgazer}
displays the calibration point for debugging
- Source:
Returns:
this
- Type
- webgazer
Type Definitions
gazeListener(prediction, elapsedTime)
Handles gaze events by providing a prediction Object and elapsed time
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
prediction |
Object | Object containing the prediction data
Properties
|
||||||||||||
elapsedTime |
integer | amount of time since begin() was called |
- Source: