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
8bcdb56c
Commit
8bcdb56c
authored
May 13, 2010
by
James Bowman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#345, cvmat() now caught and exception raised
parent
26b7ed69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
cv.cpp
modules/python/cv.cpp
+10
-1
test.py
tests/python/test.py
+1
-2
No files found.
modules/python/cv.cpp
View file @
8bcdb56c
...
...
@@ -380,7 +380,9 @@ static int is_iplimage(PyObject *o)
static
void
cvmat_dealloc
(
PyObject
*
self
)
{
cvmat_t
*
pc
=
(
cvmat_t
*
)
self
;
Py_DECREF
(
pc
->
data
);
if
(
pc
->
data
)
{
Py_DECREF
(
pc
->
data
);
}
cvFree
(
&
pc
->
a
);
PyObject_Del
(
self
);
}
...
...
@@ -656,6 +658,12 @@ static PyTypeObject cvmat_Type = {
sizeof
(
cvmat_t
),
/*basicsize*/
};
static
int
illegal_init
(
PyObject
*
self
,
PyObject
*
args
,
PyObject
*
kwds
)
{
PyErr_SetString
(
opencv_error
,
"Cannot create cvmat directly; use CreateMat() instead"
);
return
-
1
;
}
static
void
cvmat_specials
(
void
)
{
cvmat_Type
.
tp_dealloc
=
cvmat_dealloc
;
...
...
@@ -663,6 +671,7 @@ static void cvmat_specials(void)
cvmat_Type
.
tp_repr
=
cvmat_repr
;
cvmat_Type
.
tp_methods
=
cvmat_methods
;
cvmat_Type
.
tp_getset
=
cvmat_getseters
;
cvmat_Type
.
tp_init
=
illegal_init
;
}
static
int
is_cvmat
(
PyObject
*
o
)
...
...
tests/python/test.py
View file @
8bcdb56c
...
...
@@ -342,8 +342,7 @@ class FunctionTests(OpenCVTests):
self
.
assertEqual
(
m
.
type
,
t
)
self
.
assertRaises
(
cv
.
error
,
lambda
:
cv
.
CreateMat
(
0
,
100
,
cv
.
CV_8SC4
))
self
.
assertRaises
(
cv
.
error
,
lambda
:
cv
.
CreateMat
(
100
,
0
,
cv
.
CV_8SC4
))
# Uncomment when ticket #100 is fixed
# self.assertRaises(cv.error, lambda: cv.CreateMat(100, 100, 666666))
self
.
assertRaises
(
cv
.
error
,
lambda
:
cv
.
cvmat
())
def
test_DrawChessboardCorners
(
self
):
im
=
cv
.
CreateImage
((
512
,
512
),
cv
.
IPL_DEPTH_8U
,
3
)
...
...
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