mirror of
https://github.com/opencv/opencv.git
synced 2024-12-12 23:49:36 +08:00
Merge pull request #12372 from cv3d:fix/python_phantom
This commit is contained in:
commit
dce4e94f02
@ -73,14 +73,17 @@ class UMat(NewOpenCVTests):
|
||||
|
||||
_p1_mask_err = cv.calcOpticalFlowPyrLK(img1, img2, p0, None)
|
||||
|
||||
_p1_mask_err_umat0 = map(cv.UMat.get, cv.calcOpticalFlowPyrLK(img1, img2, p0_umat, None))
|
||||
_p1_mask_err_umat1 = map(cv.UMat.get, cv.calcOpticalFlowPyrLK(cv.UMat(img1), img2, p0_umat, None))
|
||||
_p1_mask_err_umat2 = map(cv.UMat.get, cv.calcOpticalFlowPyrLK(img1, cv.UMat(img2), p0_umat, None))
|
||||
_p1_mask_err_umat0 = list(map(lambda umat: umat.get(), cv.calcOpticalFlowPyrLK(img1, img2, p0_umat, None)))
|
||||
_p1_mask_err_umat1 = list(map(lambda umat: umat.get(), cv.calcOpticalFlowPyrLK(cv.UMat(img1), img2, p0_umat, None)))
|
||||
_p1_mask_err_umat2 = list(map(lambda umat: umat.get(), cv.calcOpticalFlowPyrLK(img1, cv.UMat(img2), p0_umat, None)))
|
||||
|
||||
# # results of OCL optical flow differs from CPU implementation, so result can not be easily compared
|
||||
# for p1_mask_err_umat in [p1_mask_err_umat0, p1_mask_err_umat1, p1_mask_err_umat2]:
|
||||
# for data, data_umat in zip(p1_mask_err, p1_mask_err_umat):
|
||||
# self.assertTrue(np.allclose(data, data_umat))
|
||||
for _p1_mask_err_umat in [_p1_mask_err_umat0, _p1_mask_err_umat1, _p1_mask_err_umat2]:
|
||||
for data, data_umat in zip(_p1_mask_err, _p1_mask_err_umat):
|
||||
self.assertEqual(data.shape, data_umat.shape)
|
||||
self.assertEqual(data.dtype, data_umat.dtype)
|
||||
for _p1_mask_err_umat in [_p1_mask_err_umat1, _p1_mask_err_umat2]:
|
||||
for data_umat0, data_umat in zip(_p1_mask_err_umat0[:2], _p1_mask_err_umat[:2]):
|
||||
self.assertTrue(np.allclose(data_umat0, data_umat))
|
||||
|
||||
if __name__ == '__main__':
|
||||
NewOpenCVTests.bootstrap()
|
||||
|
Loading…
Reference in New Issue
Block a user