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
5051c635
Commit
5051c635
authored
Oct 04, 2010
by
James Bowman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#593 add ConvertImage
parent
f8a14a08
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
api
modules/python/api
+4
-0
test.py
tests/python/test.py
+16
-0
No files found.
modules/python/api
View file @
5051c635
...
...
@@ -1546,6 +1546,10 @@ CalcOpticalFlowFarneback
int flags 0
# Highgui
ConvertImage
CvArr src
CvArr dst
int flags 0
NamedWindow
char* name
int flags CV_WINDOW_AUTOSIZE
...
...
tests/python/test.py
View file @
5051c635
...
...
@@ -313,6 +313,15 @@ class FunctionTests(OpenCVTests):
# just check that something was drawn
self
.
assert_
(
cv
.
Sum
(
img
)[
0
]
>
0
)
def
test_ConvertImage
(
self
):
i1
=
cv
.
GetImage
(
self
.
get_sample
(
"samples/c/lena.jpg"
,
1
))
i2
=
cv
.
CloneImage
(
i1
)
i3
=
cv
.
CloneImage
(
i1
)
cv
.
ConvertImage
(
i1
,
i2
,
cv
.
CV_CVTIMG_FLIP
+
cv
.
CV_CVTIMG_SWAP_RB
)
self
.
assertNotEqual
(
self
.
hashimg
(
i1
),
self
.
hashimg
(
i2
))
cv
.
ConvertImage
(
i2
,
i3
,
cv
.
CV_CVTIMG_FLIP
+
cv
.
CV_CVTIMG_SWAP_RB
)
self
.
assertEqual
(
self
.
hashimg
(
i1
),
self
.
hashimg
(
i3
))
def
test_ConvexHull2
(
self
):
# Draw a series of N-pointed stars, find contours, assert the contour is not convex,
# assert the hull has N segments, assert that there are N convexity defects.
...
...
@@ -618,6 +627,13 @@ class FunctionTests(OpenCVTests):
self
.
assertEqual
(
aslist
(
m2
),
range
(
5
,
9
))
self
.
assertEqual
(
aslist
(
m3
),
range
(
6
,
8
))
def
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
)
mask
=
cv
.
CreateMat
(
image
.
rows
,
image
.
cols
,
cv
.
CV_8UC1
)
cv
.
grabCut
(
image
,
mask
,
(
10
,
10
,
200
,
200
),
tmp1
,
tmp2
,
10
,
cv
.
GC_INIT_WITH_RECT
)
def
test_HoughLines2_PROBABILISTIC
(
self
):
li
=
cv
.
HoughLines2
(
self
.
yield_line_image
(),
cv
.
CreateMemStorage
(),
...
...
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