Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
ee6415bd
Commit
ee6415bd
authored
Sep 01, 2018
by
Hamdi Sahloul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improves a UMat unit test
parent
dfa8467a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
test_umat.py
modules/python/test/test_umat.py
+11
-8
No files found.
modules/python/test/test_umat.py
View file @
ee6415bd
...
...
@@ -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
))
# # 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))
_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
)))
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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment