Fix for nonlocal data requirement in test2.py

This commit is contained in:
Vitaly Tuzov
2016-04-05 11:21:22 +03:00
parent 86a725933a
commit 34b3d31f54
2 changed files with 1 additions and 94 deletions

View File

@@ -8,22 +8,7 @@ import numpy as np
import cv2
import cv2.cv as cv
class NewOpenCVTests(unittest.TestCase):
def get_sample(self, filename, iscolor = cv.CV_LOAD_IMAGE_COLOR):
if not filename in self.image_cache:
filedata = urllib2.urlopen("https://raw.github.com/Itseez/opencv/2.4/" + filename).read()
image = cv2.imdecode(np.fromstring(filedata, dtype=np.uint8), iscolor)
self.assertFalse(image is None)
self.image_cache[filename] = image
return self.image_cache[filename]
def setUp(self):
self.image_cache = {}
def hashimg(self, im):
""" Compute a hash for an image, useful for image comparisons """
return hashlib.md5(im.tostring()).digest()
from tests_common import NewOpenCVTests
# Tests to run first; check the handful of basic operations that the later tests rely on