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
b8ce65be
Commit
b8ce65be
authored
Mar 17, 2016
by
Alexander Smorkalov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6279 from terfendail:vt/pythontest_data
parents
da669569
96903dc4
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
75 additions
and
20 deletions
+75
-20
CMakeLists.txt
CMakeLists.txt
+5
-1
OpenCVPackaging.cmake
cmake/OpenCVPackaging.cmake
+1
-1
opencv_run_all_tests_unix.sh.in
cmake/templates/opencv_run_all_tests_unix.sh.in
+1
-1
CMakeLists.txt
data/CMakeLists.txt
+33
-0
__init__.py
modules/python/test/nonfree_tests/__init__.py
+0
-0
nonfree_surf.py
modules/python/test/nonfree_tests/nonfree_surf.py
+28
-0
test.py
modules/python/test/test.py
+7
-17
No files found.
CMakeLists.txt
View file @
b8ce65be
...
...
@@ -631,7 +631,11 @@ if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH)
if
(
BUILD_opencv_python
)
file
(
GLOB py_tests modules/python/test/*.py
)
install
(
PROGRAMS
${
py_tests
}
DESTINATION
${
OPENCV_TEST_INSTALL_PATH
}
COMPONENT tests
)
set
(
OPENCV_PYTHON_TESTS_LIST
"test2.py"
)
if
(
BUILD_opencv_nonfree
)
file
(
GLOB py_nonfree_tests modules/python/test/nonfree_tests/*.py
)
install
(
PROGRAMS
${
py_nonfree_tests
}
DESTINATION
${
OPENCV_TEST_INSTALL_PATH
}
/nonfree_tests COMPONENT tests
)
endif
()
set
(
OPENCV_PYTHON_TESTS_LIST
"test.py"
)
endif
()
if
(
WIN32
)
configure_file
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/templates/opencv_run_all_tests_windows.cmd.in"
...
...
cmake/OpenCVPackaging.cmake
View file @
b8ce65be
...
...
@@ -89,7 +89,7 @@ set(CPACK_COMPONENT_PYTHON_DEPENDS libs)
set
(
CPACK_DEB_PYTHON_PACKAGE_DEPENDS
"python-numpy (>=
${
PYTHON_NUMPY_VERSION
}
), python
${
PYTHON_VERSION_MAJOR_MINOR
}
"
)
set
(
CPACK_COMPONENT_TESTS_DEPENDS libs
)
if
(
HAVE_opencv_python
)
set
(
CPACK_DEB_TESTS_PACKAGE_DEPENDS
"python-numpy (>=
${
PYTHON_NUMPY_VERSION
}
), python
${
PYTHON_VERSION_MAJOR_MINOR
}
, python-py | python-pytest
"
)
set
(
CPACK_DEB_TESTS_PACKAGE_DEPENDS
"python-numpy (>=
${
PYTHON_NUMPY_VERSION
}
), python
${
PYTHON_VERSION_MAJOR_MINOR
}
"
)
endif
()
if
(
HAVE_CUDA
)
...
...
cmake/templates/opencv_run_all_tests_unix.sh.in
View file @
b8ce65be
...
...
@@ -107,7 +107,7 @@ for t in $OPENCV_PYTHON_TESTS;
do
test_name
=
`
basename
"
$t
"
`
cmd
=
"py
.test --junitxml
$test_name
.xml
\"
$OPENCV_TEST_PATH
\"
/
$t
"
cmd
=
"py
thon
\"
$OPENCV_TEST_PATH
\"
/
$t
-v
"
seg_reg
=
"s/^/
${
TEXT_CYAN
}
[
$test_name
]
${
TEXT_RESET
}
/"
# append test name
...
...
data/CMakeLists.txt
View file @
b8ce65be
...
...
@@ -18,5 +18,37 @@ if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH)
DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
DESTINATION share/OpenCV/testdata COMPONENT tests
)
if
(
BUILD_opencv_python
)
file
(
GLOB DATAFILES_CPP ../samples/cpp/left*.jpg
)
list
(
APPEND DATAFILES_CPP
"../samples/cpp/board.jpg"
"../samples/cpp/pic1.png"
"../samples/cpp/pic6.png"
"../samples/cpp/right01.jpg"
"../samples/cpp/right02.jpg"
"../samples/cpp/building.jpg"
"../samples/cpp/tsukuba_l.png"
"../samples/cpp/tsukuba_r.png"
"../samples/cpp/letter-recognition.data"
)
install
(
FILES
${
DATAFILES_CPP
}
DESTINATION share/OpenCV/testdata/samples/cpp COMPONENT tests
)
set
(
DATAFILES_C
"../samples/c/lena.jpg"
"../samples/c/box.png"
)
install
(
FILES
${
DATAFILES_C
}
DESTINATION share/OpenCV/testdata/samples/c COMPONENT tests
)
set
(
DATAFILES_GPU
"../samples/gpu/basketball1.png"
"../samples/gpu/basketball2.png"
"../samples/gpu/rubberwhale1.png"
)
install
(
FILES
${
DATAFILES_GPU
}
DESTINATION share/OpenCV/testdata/samples/gpu COMPONENT tests
)
set
(
DATAFILES_PYTHON
"../samples/python2/data/graf1.png"
"../samples/python2/data/pca_test1.jpg"
"../samples/python2/data/digits.png"
)
install
(
FILES
${
DATAFILES_PYTHON
}
DESTINATION share/OpenCV/testdata/samples/python2/data COMPONENT tests
)
set
(
DATAFILES_CASCADES
"haarcascades/haarcascade_frontalface_alt.xml"
"haarcascades/haarcascade_eye.xml"
)
install
(
FILES
${
DATAFILES_CASCADES
}
DESTINATION share/OpenCV/testdata/data/haarcascades COMPONENT tests
)
endif
()
endif
()
endif
()
\ No newline at end of file
modules/python/test/nonfree_tests/__init__.py
0 → 100644
View file @
b8ce65be
modules/python/test/nonfree_tests/nonfree_surf.py
0 → 100644
View file @
b8ce65be
#!/usr/bin/env python
# Python 2/3 compatibility
from
__future__
import
print_function
import
numpy
as
np
import
cv2
import
cv2.cv
as
cv
from
test
import
OpenCVTests
class
NonFreeFunctionTests
(
OpenCVTests
):
def
test_ExtractSURF
(
self
):
img
=
self
.
get_sample
(
"samples/c/lena.jpg"
,
0
)
w
,
h
=
cv
.
GetSize
(
img
)
for
hessthresh
in
[
300
,
400
,
500
]:
for
dsize
in
[
0
,
1
]:
for
layers
in
[
1
,
3
,
10
]:
kp
,
desc
=
cv
.
ExtractSURF
(
img
,
None
,
cv
.
CreateMemStorage
(),
(
dsize
,
hessthresh
,
3
,
layers
))
self
.
assertTrue
(
len
(
kp
)
==
len
(
desc
))
for
d
in
desc
:
self
.
assertTrue
(
len
(
d
)
==
{
0
:
64
,
1
:
128
}[
dsize
])
for
pt
,
laplacian
,
size
,
dir
,
hessian
in
kp
:
self
.
assertTrue
((
0
<=
pt
[
0
])
and
(
pt
[
0
]
<=
w
))
self
.
assertTrue
((
0
<=
pt
[
1
])
and
(
pt
[
1
]
<=
h
))
self
.
assertTrue
(
laplacian
in
[
-
1
,
0
,
1
])
self
.
assertTrue
((
0
<=
dir
)
and
(
dir
<=
360
))
self
.
assertTrue
(
hessian
>=
hessthresh
)
modules/python/test/test.py
View file @
b8ce65be
...
...
@@ -128,6 +128,7 @@ from tests_common import NewOpenCVTests
basedir
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
def
load_tests
(
loader
,
tests
,
pattern
):
tests
.
addTests
(
loader
.
discover
(
basedir
,
pattern
=
'nonfree_*.py'
))
tests
.
addTests
(
loader
.
discover
(
basedir
,
pattern
=
'test_*.py'
))
return
tests
...
...
@@ -431,23 +432,6 @@ class FunctionTests(OpenCVTests):
cv
.
SetZero
(
im
)
cv
.
DrawChessboardCorners
(
im
,
(
5
,
5
),
[
((
i
/
5
)
*
100
+
50
,(
i
%
5
)
*
100
+
50
)
for
i
in
range
(
5
*
5
)
],
1
)
def
test_ExtractSURF
(
self
):
img
=
self
.
get_sample
(
"samples/c/lena.jpg"
,
0
)
w
,
h
=
cv
.
GetSize
(
img
)
for
hessthresh
in
[
300
,
400
,
500
]:
for
dsize
in
[
0
,
1
]:
for
layers
in
[
1
,
3
,
10
]:
kp
,
desc
=
cv
.
ExtractSURF
(
img
,
None
,
cv
.
CreateMemStorage
(),
(
dsize
,
hessthresh
,
3
,
layers
))
self
.
assert_
(
len
(
kp
)
==
len
(
desc
))
for
d
in
desc
:
self
.
assert_
(
len
(
d
)
==
{
0
:
64
,
1
:
128
}[
dsize
])
for
pt
,
laplacian
,
size
,
dir
,
hessian
in
kp
:
self
.
assert_
((
0
<=
pt
[
0
])
and
(
pt
[
0
]
<=
w
))
self
.
assert_
((
0
<=
pt
[
1
])
and
(
pt
[
1
]
<=
h
))
self
.
assert_
(
laplacian
in
[
-
1
,
0
,
1
])
self
.
assert_
((
0
<=
dir
)
and
(
dir
<=
360
))
self
.
assert_
(
hessian
>=
hessthresh
)
def
test_FillPoly
(
self
):
scribble
=
cv
.
CreateImage
((
640
,
480
),
cv
.
IPL_DEPTH_8U
,
1
)
random
.
seed
(
0
)
...
...
@@ -2249,6 +2233,12 @@ if __name__ == '__main__':
print
"Local data path:"
,
args
.
data
OpenCVTests
.
repoPath
=
args
.
repo
NewOpenCVTests
.
repoPath
=
args
.
repo
if
args
.
repo
is
None
:
try
:
OpenCVTests
.
repoPath
=
os
.
environ
[
'OPENCV_TEST_DATA_PATH'
]
NewOpenCVTests
.
repoPath
=
OpenCVTests
.
repoPath
except
KeyError
:
print
(
'Missing opencv samples data. Some of tests may fail.'
)
try
:
OpenCVTests
.
dataPath
=
os
.
environ
[
'OPENCV_TEST_DATA_PATH'
]
NewOpenCVTests
.
extraTestDataPath
=
OpenCVTests
.
dataPath
...
...
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