Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ async function getPrediction(regModelIndex) {
/**
* Runs every available animation frame if webgazer is not paused
*/
var smoothingVals = new util.DataWindow(4);
var smoothingVals = new util.DataWindow(webgazer.params.gazeSmoothingWindowSize);
var k = 0;

async function loop() {
Expand Down
6 changes: 6 additions & 0 deletions src/params.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ const params = {
dataTimestep: 50,
showVideoPreview: true,
applyKalmanFilter: true,
// Higher values reduce gaze-dot jitter but increase visual latency.
gazeSmoothingWindowSize: 8, // Previous value: 4
// Kalman tuning: higher measurement noise trusts raw gaze less; lower
// process noise makes movement smoother but slower to follow fast changes.
kalmanMeasurementNoise: 120, // Previous value: 47
kalmanProcessNoiseScale: 0.08, // Previous value: 1 / 10
saveDataAcrossSessions: true,
// Whether or not to store accuracy eigenValues, used by the calibration example file
storingPoints: false,
Expand Down
5 changes: 2 additions & 3 deletions src/ridgeRegThreaded.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ reg.RidgeRegThreaded.prototype.init = function() {
[0, 1/4, 0, 1/2],
[1/2, 0, 1, 0],
[0, 1/2, 0, 1]];// * delta_t
var delta_t = 1/10; // The amount of time between frames
Q = mat.multScalar(Q, delta_t);
Q = mat.multScalar(Q, params.kalmanProcessNoiseScale);

var H = [ [1, 0, 0, 0],
[0, 1, 0, 0]];
var pixel_error = 47; //We will need to fine tune this value [20200611 xk] I just put a random value here
var pixel_error = params.kalmanMeasurementNoise;

//This matrix represents the expected measurement error
var R = mat.multScalar(mat.identity(2), pixel_error);
Expand Down
5 changes: 2 additions & 3 deletions src/util_regression.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ util_regression.InitRegression = function() {
[0, 1/4, 0, 1/2],
[1/2, 0, 1, 0],
[0, 1/2, 0, 1]];// * delta_t
var delta_t = 1/10; // The amount of time between frames
Q = mat.multScalar(Q, delta_t);
Q = mat.multScalar(Q, params.kalmanProcessNoiseScale);

var H = [ [1, 0, 0, 0],
[0, 1, 0, 0]];
var pixel_error = 47; //We will need to fine tune this value [20200611 xk] I just put a random value here
var pixel_error = params.kalmanMeasurementNoise;

//This matrix represents the expected measurement error
var R = mat.multScalar(mat.identity(2), pixel_error);
Expand Down
2 changes: 1 addition & 1 deletion www/data/src/webgazer.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion www/webgazer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion www/webgazer.js.map

Large diffs are not rendered by default.