Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c6fca3e

Browse files
one liner if
1 parent bbb4527 commit c6fca3e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎MTM/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,7 @@ def matchTemplates(listTemplates, image, method=cv2.TM_CCOEFF_NORMED, N_object=f
227227
tableHit = findMatches(listTemplates, image, method, N_object, score_threshold, searchBox)
228228

229229
if method == 0: raise ValueError("The method TM_SQDIFF is not supported. Use TM_SQDIFF_NORMED instead.")
230-
elif method == 1: sortAscending = True
231-
else: sortAscending = False
230+
sortAscending = True if method==1 else False
232231

233232
return NMS(tableHit, score_threshold, sortAscending, N_object, maxOverlap)
234233

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /