Fix for nonlocal data requirement in test2.py
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user