hopefully fixed handling of 'long' Python type in OpenCV bindings (bug #2193). added the corresponding test

This commit is contained in:
Vadim Pisarevsky
2013-01-28 21:03:59 +04:00
parent 2320ec76b4
commit 4044fbcb33
2 changed files with 19 additions and 2 deletions

View File

@@ -42,6 +42,11 @@ class Hackathon244Tests(NewOpenCVTests):
self.assert_(cv2.norm(a, cv2.NORM_L1) == 15)
absa1 = cv2.absdiff(a, 0)
self.assert_(cv2.norm(absa1, absa0, cv2.NORM_INF) == 0)
def test_imencode(self):
a = np.zeros((480, 640), dtype=np.uint8)
flag, ajpg = cv2.imencode("img_q90.jpg", a, [cv2.IMWRITE_JPEG_QUALITY, 90])
self.assert_(flag == True and ajpg.dtype == np.uint8 and ajpg.shape[0] > 1 and ajpg.shape[1] == 1)
if __name__ == '__main__':
print "testing", cv.__version__