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
f4f23400
Commit
f4f23400
authored
Jul 19, 2011
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed just introduced compile errors on Mac
parent
ff5e97c8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
cv2.cv.hpp
modules/python/src2/cv2.cv.hpp
+11
-11
No files found.
modules/python/src2/cv2.cv.hpp
View file @
f4f23400
...
...
@@ -262,7 +262,7 @@ static PyObject *iplimage_tostring(PyObject *self, PyObject *args)
bps
=
8
;
break
;
default:
return
failmsg
(
"Unrecognised depth %d"
,
i
->
depth
),
0
;
return
failmsg
(
"Unrecognised depth %d"
,
i
->
depth
),
(
PyObject
*
)
0
;
}
int
bpl
=
i
->
width
*
i
->
nChannels
*
bps
;
if
(
PyString_Check
(
pc
->
data
)
&&
bpl
==
i
->
widthStep
&&
pc
->
offset
==
0
&&
((
bpl
*
i
->
height
)
==
what_size
(
pc
->
data
)))
{
...
...
@@ -417,7 +417,7 @@ static PyObject *cvmat_tostring(PyObject *self, PyObject *args)
bps
=
CV_MAT_CN
(
m
->
type
)
*
8
;
break
;
default:
return
failmsg
(
"Unrecognised depth %d"
,
CV_MAT_DEPTH
(
m
->
type
)),
0
;
return
failmsg
(
"Unrecognised depth %d"
,
CV_MAT_DEPTH
(
m
->
type
)),
(
PyObject
*
)
0
;
}
int
bpl
=
m
->
cols
*
bps
;
// bytes per line
...
...
@@ -744,7 +744,7 @@ static PyObject *cvmatnd_tostring(PyObject *self, PyObject *args)
bps
=
CV_MAT_CN
(
m
->
type
)
*
8
;
break
;
default:
return
failmsg
(
"Unrecognised depth %d"
,
CV_MAT_DEPTH
(
m
->
type
)),
0
;
return
failmsg
(
"Unrecognised depth %d"
,
CV_MAT_DEPTH
(
m
->
type
)),
(
PyObject
*
)
0
;
}
int
d
,
l
=
bps
;
...
...
@@ -2838,20 +2838,20 @@ static PyObject *fromarray(PyObject *o, int allowND)
cvmat_t
*
m
=
PyObject_NEW
(
cvmat_t
,
&
cvmat_Type
);
if
(
pai
->
nd
==
2
)
{
if
(
pai
->
strides
[
1
]
!=
pai
->
itemsize
)
{
return
failmsg
(
"cv.fromarray array can only accept arrays with contiguous data"
),
0
;
return
failmsg
(
"cv.fromarray array can only accept arrays with contiguous data"
),
(
PyObject
*
)
0
;
}
ERRWRAP
(
m
->
a
=
cvCreateMatHeader
((
int
)
pai
->
shape
[
0
],
(
int
)
pai
->
shape
[
1
],
type
));
m
->
a
->
step
=
(
int
)
pai
->
strides
[
0
];
}
else
if
(
pai
->
nd
==
3
)
{
if
(
pai
->
shape
[
2
]
>
CV_CN_MAX
)
{
Py_DECREF
(
ao
);
return
failmsg
(
"cv.fromarray too many channels, see allowND argument"
),
0
;
return
failmsg
(
"cv.fromarray too many channels, see allowND argument"
),
(
PyObject
*
)
0
;
}
ERRWRAP
(
m
->
a
=
cvCreateMatHeader
((
int
)
pai
->
shape
[
0
],
(
int
)
pai
->
shape
[
1
],
type
+
((
int
)(
pai
->
shape
[
2
]
-
1
)
<<
CV_CN_SHIFT
)));
m
->
a
->
step
=
(
int
)
pai
->
strides
[
0
];
}
else
{
Py_DECREF
(
ao
);
return
failmsg
(
"cv.fromarray array can be 2D or 3D only, see allowND argument"
),
0
;
return
failmsg
(
"cv.fromarray array can be 2D or 3D only, see allowND argument"
),
(
PyObject
*
)
0
;
}
m
->
a
->
data
.
ptr
=
(
uchar
*
)
pai
->
data
;
//retval = pythonize_foreign_CvMat(m);
...
...
@@ -3018,18 +3018,18 @@ static PyObject *cvarr_GetItem(PyObject *o, PyObject *key)
// negative steps are illegal for OpenCV
for
(
int
i
=
0
;
i
<
dd
.
count
;
i
++
)
{
if
(
dd
.
step
[
i
]
<
0
)
return
failmsg
(
"Negative step is illegal"
),
0
;
return
failmsg
(
"Negative step is illegal"
),
(
PyObject
*
)
0
;
}
// zero length illegal for OpenCV
for
(
int
i
=
0
;
i
<
dd
.
count
;
i
++
)
{
if
(
dd
.
length
[
i
]
==
0
)
return
failmsg
(
"Zero sized dimension is illegal"
),
0
;
return
failmsg
(
"Zero sized dimension is illegal"
),
(
PyObject
*
)
0
;
}
// column step can only be 0 or 1
if
((
dd
.
step
[
dd
.
count
-
1
]
!=
0
)
&&
(
dd
.
step
[
dd
.
count
-
1
]
!=
1
))
return
failmsg
(
"Column step is illegal"
),
0
;
return
failmsg
(
"Column step is illegal"
),
(
PyObject
*
)
0
;
if
(
is_cvmat
(
o
)
||
is_iplimage
(
o
))
{
cvmat_t
*
sub
=
PyObject_NEW
(
cvmat_t
,
&
cvmat_Type
);
...
...
@@ -3476,7 +3476,7 @@ static PyObject *pycvSubdiv2DLocate(PyObject *self, PyObject *args)
Py_INCREF
(
Py_None
);
break
;
default:
return
failmsg
(
"Unexpected loc from cvSubdiv2DLocate"
),
0
;
return
failmsg
(
"Unexpected loc from cvSubdiv2DLocate"
),
(
PyObject
*
)
0
;
}
return
Py_BuildValue
(
"iO"
,
(
int
)
loc
,
r
);
}
...
...
@@ -3693,7 +3693,7 @@ static PyObject *shareData(PyObject *donor, CvArr *pdonor, CvMat *precipient)
arr_data
=
((
iplimage_t
*
)
donor
)
->
data
;
((
cvmat_t
*
)
recipient
)
->
offset
+=
((
iplimage_t
*
)
donor
)
->
offset
;
}
else
{
return
failmsg
(
"Argument 'mat' must be either IplImage or CvMat"
),
0
;
return
failmsg
(
"Argument 'mat' must be either IplImage or CvMat"
),
(
PyObject
*
)
0
;
}
((
cvmat_t
*
)
recipient
)
->
data
=
arr_data
;
Py_INCREF
(
arr_data
);
...
...
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