瀏覽代碼

Tweak the algorithm

customisations
alemart 5 月之前
父節點
當前提交
a5779645da
共有 2 個文件被更改,包括 6 次插入5 次删除
  1. 3
    2
      src/trackers/image-tracker/image-tracker-utils.ts
  2. 3
    3
      src/trackers/image-tracker/settings.ts

+ 3
- 2
src/trackers/image-tracker/image-tracker-utils.ts 查看文件

285
             }
285
             }
286
 
286
 
287
             // compute the interpolation factor t = t(alpha, beta)
287
             // compute the interpolation factor t = t(alpha, beta)
288
-            // t is alpha if beta is zero
288
+            // t is (clamped) alpha if beta is zero
289
+            const gamma = alpha * Math.pow(2, -beta);
289
             const f = 1 - Math.sqrt(d[i] / max); // f is zero when d[i] is max (hence, it minimizes t and contributes to src)
290
             const f = 1 - Math.sqrt(d[i] / max); // f is zero when d[i] is max (hence, it minimizes t and contributes to src)
290
-            const g = alpha * (1 + beta * f);
291
+            const g = (alpha - gamma) * f + gamma;
291
             const t = Math.max(0, Math.min(g, 1)); // clamp
292
             const t = Math.max(0, Math.min(g, 1)); // clamp
292
             const _t = 1 - t;
293
             const _t = 1 - t;
293
 
294
 

+ 3
- 3
src/trackers/image-tracker/settings.ts 查看文件

138
 export const TRACK_GRID_GRANULARITY = 15; //20; //10; // the value of N
138
 export const TRACK_GRID_GRANULARITY = 15; //20; //10; // the value of N
139
 
139
 
140
 /** Used to identify the best maches */
140
 /** Used to identify the best maches */
141
-export const TRACK_MATCH_RATIO = 0.7; // usually a value in [0.6, 0.8] - low values => strict tracking
141
+export const TRACK_MATCH_RATIO = 0.65; // usually a value in [0.6, 0.8] - low values => strict tracking
142
 
142
 
143
 /** Number of consecutive frames in which we tolerate a  "target lost" situation */
143
 /** Number of consecutive frames in which we tolerate a  "target lost" situation */
144
 export const TRACK_LOST_TOLERANCE = 15;
144
 export const TRACK_LOST_TOLERANCE = 15;
145
 
145
 
146
 /** Interpolation filter: interpolation factor */
146
 /** Interpolation filter: interpolation factor */
147
-export const TRACK_FILTER_ALPHA = 0.125;
147
+export const TRACK_FILTER_ALPHA = 0.2;
148
 
148
 
149
 /** Interpolation filter: correction strength for noisy corners */
149
 /** Interpolation filter: correction strength for noisy corners */
150
 export const TRACK_FILTER_BETA = 1;
150
 export const TRACK_FILTER_BETA = 1;
151
 
151
 
152
 /** Interpolation filter: translation factor */
152
 /** Interpolation filter: translation factor */
153
-export const TRACK_FILTER_TAU = 0.25;
153
+export const TRACK_FILTER_TAU = 0.2;

Loading…
取消
儲存