We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d1a864 commit 064eb68Copy full SHA for 064eb68
lib/provider/opencv/template-matching-finder.class.ts
100644
100755
@@ -179,7 +179,8 @@ export class TemplateMatchingFinder implements FinderInterface {
179
const potentialMatches = matches
180
.filter(match => match.confidence >= matchRequest.confidence);
181
if (potentialMatches.length === 0) {
182
- const bestMatch = matches.sort((a, b) => a.confidence - b.confidence).pop();
+ matches.sort((a, b) => a.confidence - b.confidence);
183
+ const bestMatch = matches.pop();
184
if (bestMatch) {
185
reject(`No match with required confidence ${matchRequest.confidence}. Best match: ${bestMatch.confidence} at ${bestMatch.location}`)
186
} else {
0 commit comments