Quellcode durchsuchen

Tweak the algorithm

customisations
alemart vor 5 Monaten
Ursprung
Commit
a5779645da

+ 3
- 2
src/trackers/image-tracker/image-tracker-utils.ts Datei anzeigen

@@ -285,9 +285,10 @@ export class ImageTrackerUtils
285 285
             }
286 286
 
287 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 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 292
             const t = Math.max(0, Math.min(g, 1)); // clamp
292 293
             const _t = 1 - t;
293 294
 

+ 3
- 3
src/trackers/image-tracker/settings.ts Datei anzeigen

@@ -138,16 +138,16 @@ export const TRACK_RANSAC_REPROJECTIONERROR_NDC = TRACK_RANSAC_REPROJECTIONERROR
138 138
 export const TRACK_GRID_GRANULARITY = 15; //20; //10; // the value of N
139 139
 
140 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 143
 /** Number of consecutive frames in which we tolerate a  "target lost" situation */
144 144
 export const TRACK_LOST_TOLERANCE = 15;
145 145
 
146 146
 /** Interpolation filter: interpolation factor */
147
-export const TRACK_FILTER_ALPHA = 0.125;
147
+export const TRACK_FILTER_ALPHA = 0.2;
148 148
 
149 149
 /** Interpolation filter: correction strength for noisy corners */
150 150
 export const TRACK_FILTER_BETA = 1;
151 151
 
152 152
 /** Interpolation filter: translation factor */
153
-export const TRACK_FILTER_TAU = 0.25;
153
+export const TRACK_FILTER_TAU = 0.2;

Laden…
Abbrechen
Speichern