|
@@ -261,13 +261,11 @@ export class ImageTrackerScanningState extends ImageTrackerState
|
261
|
261
|
// the best match should be "much better" than the second best match,
|
262
|
262
|
// which means that they are "distinct enough"
|
263
|
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
|
|