Skip to content

Commit 2db3644

Browse files
committed
Create testCL.py
1 parent 3423c28 commit 2db3644

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

testCL.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Benchmark template matching with opencl
4+
Use spyder profiler
5+
to try on other devices too
6+
"""
7+
8+
from skimage.data import coins
9+
import cv2
10+
11+
#%% Get image and templates by cropping
12+
image = coins()
13+
smallCoin = image[37:37+38, 80:80+41]
14+
15+
imageCL, smallCoinCL = map(cv2.UMat, [image, smallCoin])
16+
17+
def test():
18+
return cv2.matchTemplate(image, smallCoin, 0)
19+
20+
def testCL():
21+
return cv2.matchTemplate(imageCL, smallCoinCL, 0)
22+
23+
out = test()
24+
outCL = testCL()

0 commit comments

Comments
 (0)