Browse Source

Cleanup

customisations
alemart 2 weeks ago
parent
commit
5be50a393a
1 changed files with 5 additions and 7 deletions
  1. 5
    7
      src/trackers/image-tracker/states/scanning.ts

+ 5
- 7
src/trackers/image-tracker/states/scanning.ts View File

261
                 // the best match should be "much better" than the second best match,
261
                 // the best match should be "much better" than the second best match,
262
                 // which means that they are "distinct enough"
262
                 // which means that they are "distinct enough"
263
                 if(d1 <= SCAN_MATCH_RATIO * d2) {
263
                 if(d1 <= SCAN_MATCH_RATIO * d2) {
264
-                    const idx1 = this._imageTracker._referenceImageIndexOfKeypoint(keypoint.matches[0].index);
265
-                    //const idx2 = this._imageTracker._referenceImageIndexOfKeypoint(keypoint.matches[1].index);
266
-                    //if(idx1 == idx2 && idx1 >= 0) {
267
-                    if(idx1 >= 0) {
268
-                        if(!Object.prototype.hasOwnProperty.call(matchedKeypointsPerImageIndex, idx1))
269
-                            matchedKeypointsPerImageIndex[idx1] = [];
270
-                        matchedKeypointsPerImageIndex[idx1].push(keypoint);
264
+                    const idx = this._imageTracker._referenceImageIndexOfKeypoint(keypoint.matches[0].index);
265
+                    if(idx >= 0) {
266
+                        if(!Object.prototype.hasOwnProperty.call(matchedKeypointsPerImageIndex, idx))
267
+                            matchedKeypointsPerImageIndex[idx] = [];
268
+                        matchedKeypointsPerImageIndex[idx].push(keypoint);
271
                     }
269
                     }
272
                 }
270
                 }
273
 
271
 

Loading…
Cancel
Save