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
5d0d485f
Commit
5d0d485f
authored
Jan 19, 2011
by
James Bowman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better tests for ticket #759
parent
d2d52c73
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
leak1.py
tests/python/leak1.py
+7
-0
leak2.py
tests/python/leak2.py
+10
-0
test.py
tests/python/test.py
+3
-4
No files found.
tests/python/leak1.py
0 → 100644
View file @
5d0d485f
import
cv
import
numpy
as
np
cv
.
NamedWindow
(
'Leak'
)
while
1
:
leak
=
np
.
random
.
random
((
480
,
640
))
*
255
cv
.
ShowImage
(
'Leak'
,
leak
.
astype
(
np
.
uint8
))
cv
.
WaitKey
(
10
)
tests/python/leak2.py
0 → 100644
View file @
5d0d485f
import
cv
import
numpy
as
np
import
time
while
True
:
for
i
in
range
(
4000
):
a
=
cv
.
CreateImage
((
1024
,
1024
),
cv
.
IPL_DEPTH_8U
,
1
)
b
=
cv
.
CreateMat
(
1024
,
1024
,
cv
.
CV_8UC1
)
# c = cv.CreateMatND([1024,1024], cv.CV_8UC1)
print
"pause..."
tests/python/test.py
View file @
5d0d485f
import
roslib
;
roslib
.
load_manifest
(
'opencv2'
)
import
unittest
import
random
import
time
...
...
@@ -628,7 +627,7 @@ class FunctionTests(OpenCVTests):
self
.
assertEqual
(
aslist
(
m2
),
range
(
5
,
9
))
self
.
assertEqual
(
aslist
(
m3
),
range
(
6
,
8
))
def
test_grabCut
(
self
):
def
x
test_grabCut
(
self
):
image
=
self
.
get_sample
(
"samples/c/lena.jpg"
,
cv
.
CV_LOAD_IMAGE_COLOR
)
tmp1
=
cv
.
CreateMat
(
1
,
13
*
5
,
cv
.
CV_32FC1
)
tmp2
=
cv
.
CreateMat
(
1
,
13
*
5
,
cv
.
CV_32FC1
)
...
...
@@ -1008,9 +1007,9 @@ class AreaTests(OpenCVTests):
def
test_leak
(
self
):
""" If CreateImage is not releasing image storage, then the loop below should use ~4GB of memory. """
for
i
in
range
(
4000
):
for
i
in
range
(
6
4000
):
a
=
cv
.
CreateImage
((
1024
,
1024
),
cv
.
IPL_DEPTH_8U
,
1
)
for
i
in
range
(
4000
):
for
i
in
range
(
6
4000
):
a
=
cv
.
CreateMat
(
1024
,
1024
,
cv
.
CV_8UC1
)
def
test_histograms
(
self
):
...
...
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