Skip to content

Commit d2c612f

Browse files
template matching
1 parent ac5e609 commit d2c612f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import numpy as np
2+
import cv2
3+
template=cv2.imread('template.jpg')
4+
frame=cv2.imread('players.jpg')
5+
cv2.imshow('Template',template)
6+
cv2.imshow('Frame',frame)
7+
8+
result=cv2.matchTemplate(frame,template,cv2.TM_CCOEFF_NORMED)
9+
cv2.imshow('result1',result)
10+
min_val,max_val,min_loc,max_loc=cv2.minMaxLoc(result)
11+
cv2.circle(result,max_loc,15,255,-1)
12+
cv2.imshow('result2',result)
13+
cv2.waitKey(0)
14+
cv2.destroyAllWindows()

0 commit comments

Comments
 (0)