|
@@ -306,6 +306,24 @@ export class ImageTrackerTrackingState extends ImageTrackerState
|
306
|
306
|
})
|
307
|
307
|
.then(warpMotion => {
|
308
|
308
|
|
|
309
|
+ // apply filter
|
|
310
|
+ return ImageTrackerUtils.interpolateHomographies(
|
|
311
|
+ NO_MOTION,
|
|
312
|
+ Speedy.Matrix(warpMotion),
|
|
313
|
+ TRACK_FILTER_ALPHA,
|
|
314
|
+ TRACK_FILTER_BETA,
|
|
315
|
+ TRACK_FILTER_TAU,
|
|
316
|
+ TRACK_FILTER_OMEGA
|
|
317
|
+ );
|
|
318
|
+
|
|
319
|
+ })
|
|
320
|
+ .then(warpMotion => {
|
|
321
|
+
|
|
322
|
+ // update warp homography
|
|
323
|
+ this._warpHomography.setToSync(warpMotion.times(this._warpHomography));
|
|
324
|
+ return this._warpHomography;
|
|
325
|
+
|
|
326
|
+ /*
|
309
|
327
|
const lowPower = (Settings.powerPreference == 'low-power');
|
310
|
328
|
const delay = NUMBER_OF_PBOS * (!lowPower ? 2 : 1);
|
311
|
329
|
|
|
@@ -319,21 +337,17 @@ export class ImageTrackerTrackingState extends ImageTrackerState
|
319
|
337
|
// apply filter
|
320
|
338
|
return ImageTrackerUtils.interpolateHomographies(
|
321
|
339
|
this._poseHomography,
|
322
|
|
- Speedy.Matrix(warpMotion.times(this._warpHomography)),
|
323
|
|
- TRACK_FILTER_ALPHA,
|
324
|
|
- TRACK_FILTER_BETA,
|
325
|
|
- TRACK_FILTER_TAU,
|
326
|
|
- TRACK_FILTER_OMEGA
|
|
340
|
+ this._warpHomography,
|
|
341
|
+ 0.4,//TRACK_FILTER_ALPHA,
|
|
342
|
+ 1,//TRACK_FILTER_BETA,
|
|
343
|
+ 0.4,//TRACK_FILTER_TAU,
|
|
344
|
+ 0.05,//TRACK_FILTER_OMEGA
|
327
|
345
|
);
|
|
346
|
+ */
|
328
|
347
|
|
329
|
348
|
})
|
330
|
349
|
.then(filteredHomography => {
|
331
|
350
|
|
332
|
|
- // update pose homography
|
333
|
|
- this._poseHomography.setToSync(filteredHomography);
|
334
|
|
- if(Number.isNaN(this._poseHomography.at(0,0)))
|
335
|
|
- throw new NumericalError('Bad homography'); // normalize? 1 / h33
|
336
|
|
-
|
337
|
351
|
/*
|
338
|
352
|
// test
|
339
|
353
|
console.log("WARP ", this._warpHomography.toString());
|
|
@@ -341,6 +355,11 @@ export class ImageTrackerTrackingState extends ImageTrackerState
|
341
|
355
|
console.log("FILT ", filteredHomography.toString());
|
342
|
356
|
*/
|
343
|
357
|
|
|
358
|
+ // update pose homography
|
|
359
|
+ this._poseHomography.setToSync(filteredHomography);
|
|
360
|
+ if(Number.isNaN(this._poseHomography.at(0,0)))
|
|
361
|
+ throw new NumericalError('Bad homography'); // normalize? 1 / h33
|
|
362
|
+
|
344
|
363
|
// We transform the keypoints of the reference image to NDC as a
|
345
|
364
|
// convenience. However, doing so distorts the aspect ratio. Here
|
346
|
365
|
// we undo the distortion.
|