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
0c6e09f0
Commit
0c6e09f0
authored
9 years ago
by
Vladislav Sovrasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes in facedetect test
parent
87fc75c6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
8 deletions
+18
-8
test.py
modules/python/test/test.py
+5
-0
test_facedetect.py
modules/python/test/test_facedetect.py
+7
-8
tests_common.py
modules/python/test/tests_common.py
+6
-0
kate.jpg
samples/data/kate.jpg
+0
-0
No files found.
modules/python/test/test.py
View file @
0c6e09f0
...
...
@@ -133,6 +133,10 @@ if __name__ == '__main__':
print
(
"Testing OpenCV"
,
cv2
.
__version__
)
print
(
"Local repo path:"
,
args
.
repo
)
NewOpenCVTests
.
repoPath
=
args
.
repo
try
:
NewOpenCVTests
.
extraTestDataPath
=
os
.
environ
[
'OPENCV_TEST_DATA_PATH'
]
except
KeyError
:
pass
random
.
seed
(
0
)
unit_argv
=
[
sys
.
argv
[
0
]]
+
other
;
unittest
.
main
(
argv
=
unit_argv
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
modules/python/test/test_facedetect.py
View file @
0c6e09f0
...
...
@@ -31,8 +31,7 @@ class facedetect_test(NewOpenCVTests):
cascade
=
cv2
.
CascadeClassifier
(
cascade_fn
)
nested
=
cv2
.
CascadeClassifier
(
nested_fn
)
dirPath
=
'samples/data/'
samples
=
[
'lena.jpg'
,
'kate.jpg'
]
samples
=
[
'samples/data/lena.jpg'
,
'cv/cascadeandhog/images/mona-lisa.png'
]
faces
=
[]
eyes
=
[]
...
...
@@ -43,17 +42,17 @@ class facedetect_test(NewOpenCVTests):
[
244
,
240
,
294
,
290
],
[
309
,
246
,
352
,
289
]],
#
kate
[[
207
,
89
,
436
,
318
],
[
245
,
161
,
294
,
210
],
[
343
,
139
,
389
,
185
]]
#
lisa
[[
167
,
119
,
307
,
259
],
[
188
,
153
,
229
,
194
],
[
236
,
153
,
277
,
194
]]
]
for
sample
in
samples
:
img
=
self
.
get_sample
(
dirPath
+
sample
)
img
=
self
.
get_sample
(
sample
)
gray
=
cv2
.
cvtColor
(
img
,
cv2
.
COLOR_BGR2GRAY
)
gray
=
cv2
.
GaussianBlur
(
gray
,
(
3
,
3
),
1
.1
)
gray
=
cv2
.
GaussianBlur
(
gray
,
(
5
,
5
),
5
.1
)
rects
=
detect
(
gray
,
cascade
)
faces
.
append
(
rects
)
...
...
This diff is collapsed.
Click to expand it.
modules/python/test/tests_common.py
View file @
0c6e09f0
...
...
@@ -19,6 +19,7 @@ class NewOpenCVTests(unittest.TestCase):
# path to local repository folder containing 'samples' folder
repoPath
=
None
extraTestDataPath
=
None
# github repository url
repoUrl
=
'https://raw.github.com/Itseez/opencv/master'
...
...
@@ -30,6 +31,11 @@ class NewOpenCVTests(unittest.TestCase):
if
os
.
path
.
isfile
(
candidate
):
with
open
(
candidate
,
'rb'
)
as
f
:
filedata
=
f
.
read
()
if
NewOpenCVTests
.
extraTestDataPath
is
not
None
:
candidate
=
NewOpenCVTests
.
extraTestDataPath
+
'/'
+
filename
if
os
.
path
.
isfile
(
candidate
):
with
open
(
candidate
,
'rb'
)
as
f
:
filedata
=
f
.
read
()
if
filedata
is
None
:
filedata
=
urlopen
(
NewOpenCVTests
.
repoUrl
+
'/'
+
filename
)
.
read
()
self
.
image_cache
[
filename
]
=
cv2
.
imdecode
(
np
.
fromstring
(
filedata
,
dtype
=
np
.
uint8
),
iscolor
)
...
...
This diff is collapsed.
Click to expand it.
samples/data/kate.jpg
deleted
100644 → 0
View file @
87fc75c6
39.8 KB
This diff is collapsed.
Click to expand it.
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