Added GIL-release code into python wrappers
Added gabor_threads.py sample
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import numpy as np
|
||||
import cv2
|
||||
import os
|
||||
from contextlib import contextmanager
|
||||
|
||||
image_extensions = ['.bmp', '.jpg', '.jpeg', '.png', '.tif', '.tiff', '.pbm', '.pgm', '.ppm']
|
||||
|
||||
@@ -116,6 +117,15 @@ def nothing(*arg, **kw):
|
||||
def clock():
|
||||
return cv2.getTickCount() / cv2.getTickFrequency()
|
||||
|
||||
@contextmanager
|
||||
def Timer(msg):
|
||||
print msg, '...',
|
||||
start = clock()
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
print "%.2f ms" % ((clock()-start)*1000)
|
||||
|
||||
class RectSelector:
|
||||
def __init__(self, win, callback):
|
||||
self.win = win
|
||||
|
Reference in New Issue
Block a user